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
This commit is contained in:
Steve Baker 2016-07-27 23:31:50 +00:00
parent 6c9f33dade
commit 395cfbd1dd
4 changed files with 26 additions and 15 deletions

View File

@ -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

View File

@ -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

View File

@ -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 = <None>

View File

@ -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