blob: 71fabe13b9e90ffe6068a67837b008872321d8d5 [file] [log] [blame]
Steve Baker450aa7f2014-08-25 10:37:27 +12001# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13import os
14import sys
15
16from oslo.config import cfg
17
18import heat_integrationtests
19
20
21IntegrationTestGroup = [
22
23 cfg.StrOpt('username',
24 default=os.environ.get('OS_USERNAME'),
25 help="Username to use for API requests."),
26 cfg.StrOpt('password',
27 default=os.environ.get('OS_PASSWORD'),
28 help="API key to use when authenticating.",
29 secret=True),
30 cfg.StrOpt('tenant_name',
31 default=os.environ.get('OS_TENANT_NAME'),
32 help="Tenant name to use for API requests."),
33 cfg.StrOpt('auth_url',
34 default=os.environ.get('OS_AUTH_URL'),
35 help="Full URI of the OpenStack Identity API (Keystone), v2"),
36 cfg.StrOpt('region',
37 default=os.environ.get('OS_REGION_NAME'),
38 help="The region name to us"),
39 cfg.StrOpt('instance_type',
Steve Bakere64590b2014-10-07 13:22:41 +130040 default=os.environ.get('HEAT_TEST_INSTANCE_TYPE'),
Steve Baker450aa7f2014-08-25 10:37:27 +120041 help="Instance type for tests. Needs to be big enough for a "
42 "full OS plus the test workload"),
43 cfg.StrOpt('image_ref',
Steve Bakere64590b2014-10-07 13:22:41 +130044 default=os.environ.get('HEAT_TEST_IMAGE_REF'),
Steve Baker450aa7f2014-08-25 10:37:27 +120045 help="Name of image to use for tests which boot servers."),
46 cfg.StrOpt('keypair_name',
47 default=None,
48 help="Name of existing keypair to launch servers with."),
49 cfg.StrOpt('minimal_image_ref',
Steve Bakere64590b2014-10-07 13:22:41 +130050 default=os.environ.get('HEAT_TEST_MINIMAL_IMAGE_REF'),
Steve Baker450aa7f2014-08-25 10:37:27 +120051 help="Name of minimal (e.g cirros) image to use when "
52 "launching test instances."),
53 cfg.StrOpt('auth_version',
54 default='v2',
55 help="Identity API version to be used for authentication "
56 "for API tests."),
57 cfg.BoolOpt('disable_ssl_certificate_validation',
58 default=False,
59 help="Set to True if using self-signed SSL certificates."),
60 cfg.IntOpt('build_interval',
61 default=4,
62 help="Time in seconds between build status checks."),
63 cfg.IntOpt('build_timeout',
64 default=1200,
65 help="Timeout in seconds to wait for a stack to build."),
66 cfg.StrOpt('network_for_ssh',
67 default='private',
68 help="Network used for SSH connections."),
69 cfg.StrOpt('fixed_network_name',
70 default='private',
71 help="Visible fixed network name "),
72 cfg.IntOpt('ssh_timeout',
73 default=300,
74 help="Timeout in seconds to wait for authentication to "
75 "succeed."),
76 cfg.IntOpt('ip_version_for_ssh',
77 default=4,
78 help="IP version used for SSH connections."),
79 cfg.IntOpt('ssh_channel_timeout',
80 default=60,
81 help="Timeout in seconds to wait for output from ssh "
82 "channel."),
83 cfg.IntOpt('tenant_network_mask_bits',
84 default=28,
85 help="The mask bits for tenant ipv4 subnets"),
86 cfg.IntOpt('volume_size',
87 default=1,
88 help='Default size in GB for volumes created by volumes tests'),
89]
90
91
92def init_conf(read_conf=True):
93
94 default_config_files = None
95 if read_conf:
96 confpath = os.path.join(
97 os.path.dirname(os.path.realpath(heat_integrationtests.__file__)),
98 'heat_integrationtests.conf')
99 if os.path.isfile(confpath):
100 default_config_files = [confpath]
101
102 conf = cfg.ConfigOpts()
103 conf(args=[], project='heat_integrationtests',
104 default_config_files=default_config_files)
105
106 for opt in IntegrationTestGroup:
107 conf.register_opt(opt)
108 return conf
109
110
111if __name__ == '__main__':
112 cfg.CONF = init_conf(False)
113 import heat.openstack.common.config.generator as generate
114 generate.generate(sys.argv[1:])