Move CONF.service_available.ironic to our plugin

This is unwanted in tempest's plugin, bring it here instead.

Also add skip checks for our tests to skip the tests if ironic is not
enabled. This allows the plugin to be installed in a tempest
environment, without breaking if ironic isn't present.

Last, drop 'baremetal' from the test.services decorators used, as it is
no longer in tempest's service list, and we use the skip check mentioned
above instead.

Conflicts:
  ironic_tempest_plugin/tests/scenario/baremetal_manager.py
  ironic_tempest_plugin/tests/scenario/test_baremetal_multitenancy.py

Change-Id: I0b7e32dfad2ed63f9dd4d7cad130da39bc869a8a
Depends-On: Idede322190d57491d4f7e18090aa8c29b5b87353
(cherry picked from commit 8ad0a424b3)
This commit is contained in:
Jim Rollenhagen 2016-11-29 16:57:30 -05:00 committed by John L. Villalovos
parent 2f5787e5b8
commit 26dcd6b7a0
6 changed files with 15 additions and 2 deletions

View File

@ -1021,6 +1021,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"
@ -1032,7 +1034,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
}
# Restore xtrace + pipefail

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

@ -58,6 +58,8 @@ class BaseBaremetalTest(test.BaseTestCase):
@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

@ -59,6 +59,8 @@ class BaremetalScenarioTest(manager.ScenarioTest):
if CONF.network_feature_enabled.port_admin_state_change:
msg = "Port state change feature isn't supported by Ironic."
raise cls.skipException(msg)
if not CONF.service_available.ironic:
raise cls.skipException('Ironic is not enabled.')
@classmethod
def setup_clients(cls):

View File

@ -108,7 +108,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.boot_instance()