diff options
author | Jim Rollenhagen <jim@jimrollenhagen.com> | 2016-11-29 16:57:30 -0500 |
---|---|---|
committer | John L. Villalovos <john.l.villalovos@intel.com> | 2017-01-06 08:51:44 -0800 |
commit | 26dcd6b7a02ca2e5d60c1f1a4223e5737602956e (patch) | |
tree | fdc4985cb86bc91fac425a3d8e026ff3ab696bd7 | |
parent | 2f5787e5b8db9f843afeb8053e9ee85234c2e690 (diff) | |
download | ironic-26dcd6b7a02ca2e5d60c1f1a4223e5737602956e.tar.gz |
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 8ad0a424b3e3963b9fdda0e1b64d8a065ef978d2)
-rw-r--r-- | devstack/lib/ironic | 3 | ||||
-rw-r--r-- | ironic_tempest_plugin/config.py | 6 | ||||
-rw-r--r-- | ironic_tempest_plugin/plugin.py | 2 | ||||
-rw-r--r-- | ironic_tempest_plugin/tests/api/admin/base.py | 2 | ||||
-rw-r--r-- | ironic_tempest_plugin/tests/scenario/baremetal_manager.py | 2 | ||||
-rw-r--r-- | ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py | 2 |
6 files changed, 15 insertions, 2 deletions
diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 11ea1ddd3..fd1d688c8 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -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 diff --git a/ironic_tempest_plugin/config.py b/ironic_tempest_plugin/config.py index 5fc1062e5..05d1772be 100644 --- a/ironic_tempest_plugin/config.py +++ b/ironic_tempest_plugin/config.py @@ -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 ' diff --git a/ironic_tempest_plugin/plugin.py b/ironic_tempest_plugin/plugin.py index c18f68a5c..dbe0f0b13 100644 --- a/ironic_tempest_plugin/plugin.py +++ b/ironic_tempest_plugin/plugin.py @@ -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) diff --git a/ironic_tempest_plugin/tests/api/admin/base.py b/ironic_tempest_plugin/tests/api/admin/base.py index 61270c739..3cf59ee11 100644 --- a/ironic_tempest_plugin/tests/api/admin/base.py +++ b/ironic_tempest_plugin/tests/api/admin/base.py @@ -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.' % diff --git a/ironic_tempest_plugin/tests/scenario/baremetal_manager.py b/ironic_tempest_plugin/tests/scenario/baremetal_manager.py index 8fe95784a..57ff37059 100644 --- a/ironic_tempest_plugin/tests/scenario/baremetal_manager.py +++ b/ironic_tempest_plugin/tests/scenario/baremetal_manager.py @@ -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): diff --git a/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py b/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py index 63831ce07..eca77db42 100644 --- a/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py +++ b/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py @@ -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() |