From 395cfbd1dd23e044adc727f8ba52cf63dc586b6a Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Wed, 27 Jul 2016 23:31:50 +0000 Subject: [PATCH] Adopt tempest plugin config namespace As a transition strategy to running heat_integrationtests as a tempest plugin, this change puts the test config values in the "heat_plugin" section. This will allow for either test runner to be used during the transition. blueprint tempest-plugin-support Change-Id: I2eab50be92c998aeb1ee98011908a9828a7efe6c --- heat_integrationtests/common/config.py | 13 +++++++++---- heat_integrationtests/common/test.py | 4 ++-- .../heat_integrationtests.conf.sample | 6 ++++++ heat_integrationtests/prepare_test_env.sh | 18 +++++++++--------- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/heat_integrationtests/common/config.py b/heat_integrationtests/common/config.py index 398379244f..fd6ccbf0e3 100644 --- a/heat_integrationtests/common/config.py +++ b/heat_integrationtests/common/config.py @@ -17,8 +17,13 @@ from oslo_config import cfg import heat_integrationtests -IntegrationTestGroup = [ +heat_group = cfg.OptGroup(name="heat_plugin", + title="Heat Service Options") +HeatGroup = [ + cfg.StrOpt("catalog_type", + default="orchestration", + help="Catalog type of the orchestration service."), cfg.StrOpt('username', default=os.environ.get('OS_USERNAME'), help="Username to use for non admin API requests."), @@ -162,10 +167,10 @@ def init_conf(read_conf=True): conf(args=[], project='heat_integrationtests', default_config_files=default_config_files) - for opt in IntegrationTestGroup: - conf.register_opt(opt) + for group, opts in list_opts(): + conf.register_opts(opts, group=group) return conf def list_opts(): - yield None, IntegrationTestGroup + yield heat_group.name, HeatGroup diff --git a/heat_integrationtests/common/test.py b/heat_integrationtests/common/test.py index c864d3b7ad..413e51f152 100644 --- a/heat_integrationtests/common/test.py +++ b/heat_integrationtests/common/test.py @@ -73,7 +73,7 @@ class HeatIntegrationTest(testscenarios.WithScenarios, def setUp(self): super(HeatIntegrationTest, self).setUp() - self.conf = config.init_conf() + self.conf = config.init_conf().heat_plugin self.assertIsNotNone(self.conf.auth_url, 'No auth_url configured') @@ -106,7 +106,7 @@ class HeatIntegrationTest(testscenarios.WithScenarios, 'No admin username configured') self.assertIsNotNone(self.conf.admin_password, 'No admin password configured') - conf = config.init_conf() + conf = config.init_conf().heat_plugin conf.username = self.conf.admin_username conf.password = self.conf.admin_password conf.tenant_name = self.conf.admin_tenant_name diff --git a/heat_integrationtests/heat_integrationtests.conf.sample b/heat_integrationtests/heat_integrationtests.conf.sample index 0e0668584e..f7aa8607fe 100644 --- a/heat_integrationtests/heat_integrationtests.conf.sample +++ b/heat_integrationtests/heat_integrationtests.conf.sample @@ -1,9 +1,15 @@ [DEFAULT] + +[heat_plugin] + # # From heat_integrationtests.common.config # +# Catalog type of the orchestration service. (string value) +#catalog_type = orchestration + # Username to use for non admin API requests. (string value) #username = diff --git a/heat_integrationtests/prepare_test_env.sh b/heat_integrationtests/prepare_test_env.sh index 827d34a8f9..0ce9b4d38a 100755 --- a/heat_integrationtests/prepare_test_env.sh +++ b/heat_integrationtests/prepare_test_env.sh @@ -25,8 +25,8 @@ source $DEST/devstack/inc/ini-config cd $DEST/heat/heat_integrationtests # Register the flavors for booting test servers -iniset heat_integrationtests.conf DEFAULT instance_type m1.heat_int -iniset heat_integrationtests.conf DEFAULT minimal_instance_type m1.heat_micro +iniset heat_integrationtests.conf heat_plugin instance_type m1.heat_int +iniset heat_integrationtests.conf heat_plugin minimal_instance_type m1.heat_micro openstack flavor create m1.heat_int --ram 512 openstack flavor create m1.heat_micro --ram 128 @@ -38,16 +38,16 @@ if [[ ${PIPESTATUS[0]} -ne 0 ]]; then exit 1 fi -iniset heat_integrationtests.conf DEFAULT image_ref fedora-heat-test-image -iniset heat_integrationtests.conf DEFAULT boot_config_env $DEST/heat-templates/hot/software-config/boot-config/test_image_env.yaml -iniset heat_integrationtests.conf DEFAULT heat_config_notify_script $DEST/heat-templates/hot/software-config/elements/heat-config/bin/heat-config-notify -iniset heat_integrationtests.conf DEFAULT minimal_image_ref cirros-0.3.4-x86_64-uec +iniset heat_integrationtests.conf heat_plugin image_ref fedora-heat-test-image +iniset heat_integrationtests.conf heat_plugin boot_config_env $DEST/heat-templates/hot/software-config/boot-config/test_image_env.yaml +iniset heat_integrationtests.conf heat_plugin heat_config_notify_script $DEST/heat-templates/hot/software-config/elements/heat-config/bin/heat-config-notify +iniset heat_integrationtests.conf heat_plugin minimal_image_ref cirros-0.3.4-x86_64-uec # admin creds already sourced, store in conf -iniset heat_integrationtests.conf DEFAULT admin_username $OS_USERNAME -iniset heat_integrationtests.conf DEFAULT admin_password $OS_PASSWORD +iniset heat_integrationtests.conf heat_plugin admin_username $OS_USERNAME +iniset heat_integrationtests.conf heat_plugin admin_password $OS_PASSWORD # Add scenario tests to skip # VolumeBackupRestoreIntegrationTest skipped until failure rate can be reduced ref bug #1382300 -iniset heat_integrationtests.conf DEFAULT skip_scenario_test_list 'SoftwareConfigIntegrationTest, VolumeBackupRestoreIntegrationTest' +iniset heat_integrationtests.conf heat_plugin skip_scenario_test_list 'SoftwareConfigIntegrationTest, VolumeBackupRestoreIntegrationTest' cat heat_integrationtests.conf