Merge "Move CONF.service_available.ironic to our plugin"

This commit is contained in:
Jenkins 2016-12-16 13:41:09 +00:00 committed by Gerrit Code Review
commit d0e1d5e1f8
7 changed files with 20 additions and 3 deletions

View File

@ -1693,6 +1693,8 @@ function cleanup_baremetal_basic_ops {
}
function ironic_configure_tempest {
iniset $TEMPEST_CONFIG service_available ironic True
local bm_flavor_id
bm_flavor_id=$(openstack flavor show baremetal -f value -c id)
die_if_not_set $LINENO bm_flavor_id "Failed to get id of baremetal flavor"
@ -1713,7 +1715,6 @@ function ironic_configure_tempest {
# tree, but not from our tree. This is a bit inconsistent, we should
# fix it.
iniset $TEMPEST_CONFIG network shared_physical_network True
iniset $TEMPEST_CONFIG network-feature-enabled port_admin_state_change False
}
function get_ironic_node_prefix {

View File

@ -18,6 +18,12 @@ from oslo_config import cfg
from tempest import config # noqa
service_option = cfg.BoolOpt('ironic',
default=False,
help='Whether or not Ironic is expected to be '
'available')
baremetal_group = cfg.OptGroup(name='baremetal',
title='Baremetal provisioning service options',
help='When enabling baremetal tests, Nova '

View File

@ -31,6 +31,8 @@ class IronicTempestPlugin(plugins.TempestPlugin):
return full_test_dir, base_path
def register_opts(self, conf):
conf.register_opt(project_config.service_option,
group='service_available')
config.register_opt_group(conf, project_config.baremetal_group,
project_config.BaremetalGroup)

View File

@ -61,6 +61,8 @@ class BaseBaremetalTest(api_version_utils.BaseMicroversionTest,
@classmethod
def skip_checks(cls):
super(BaseBaremetalTest, cls).skip_checks()
if not CONF.service_available.ironic:
raise cls.skipException('Ironic is not enabled.')
if CONF.baremetal.driver not in SUPPORTED_DRIVERS:
skip_msg = ('%s skipped as Ironic driver %s is not supported for '
'testing.' %

View File

@ -55,6 +55,12 @@ class BaremetalScenarioTest(manager.ScenarioTest):
credentials = ['primary', 'admin']
@classmethod
def skip_checks(cls):
super(BaremetalScenarioTest, cls).skip_checks()
if not CONF.service_available.ironic:
raise cls.skipException('Ironic is not enabled.')
@classmethod
def setup_clients(cls):
super(BaremetalScenarioTest, cls).setup_clients()

View File

@ -105,7 +105,7 @@ class BaremetalBasicOps(baremetal_manager.BaremetalScenarioTest):
self.assertEqual(n_port['mac_address'], port['address'])
@test.idempotent_id('549173a5-38ec-42bb-b0e2-c8b9f4a08943')
@test.services('baremetal', 'compute', 'image', 'network')
@test.services('compute', 'image', 'network')
def test_baremetal_server_ops(self):
self.add_keypair()
self.instance, self.node = self.boot_instance()

View File

@ -80,7 +80,7 @@ class BaremetalMultitenancy(baremetal_manager.BaremetalScenarioTest,
self.assertNotIn(success_substring, output)
@test.idempotent_id('26e2f145-2a8e-4dc7-8457-7f2eb2c6749d')
@test.services('baremetal', 'compute', 'image', 'network')
@test.services('compute', 'image', 'network')
def test_baremetal_multitenancy(self):
tenant_cidr = '10.0.100.0/24'