From a39a7a79ebb6f6317c8d4b2dd3dedb8e6a86c262 Mon Sep 17 00:00:00 2001 From: Eric K Date: Tue, 21 Aug 2018 18:59:09 -0700 Subject: [PATCH] skipping some tests for queens skipping vitrage_webhook and monasca_webhook based on feature flags. skipping nova driver tests for queens because congress nova driver in queens does not work with the new novaclient 10.1.0 now part of upper-constraints due to https://review.openstack.org/#/c/571540/ Change-Id: I199f329bc6eae2c4656daceda8bb978614d0d6cc --- congress_tempest_plugin/config.py | 15 +++++++++++++++ congress_tempest_plugin/plugin.py | 6 +++++- .../scenario/congress_datasources/test_monasca.py | 8 ++++++++ .../scenario/congress_datasources/test_nova.py | 8 ++++++++ .../scenario/congress_datasources/test_vitrage.py | 12 ++++++++++++ .../tests/scenario/test_congress_basic_ops.py | 7 +++++++ 6 files changed, 55 insertions(+), 1 deletion(-) diff --git a/congress_tempest_plugin/config.py b/congress_tempest_plugin/config.py index 40643f7..f9aad38 100755 --- a/congress_tempest_plugin/config.py +++ b/congress_tempest_plugin/config.py @@ -25,6 +25,21 @@ ServiceAvailableGroup = [ default=True, help="Whether or not Congress is expected to be available"), ] + +congress_feature_group = cfg.OptGroup(name="congress-feature-enabled", + title="Congress Feature Flags") +CongressFeatureGroup = [ + cfg.BoolOpt('monasca_webhook', + default=False, + help="monasca_webhook feature available"), + cfg.BoolOpt('vitrage_webhook', + default=False, + help="vitrage_webhook feature available"), + cfg.BoolOpt('nova_driver', + default=True, + help="nova driver feature available"), +] + congressha_group = cfg.OptGroup(name="congressha", title="Congress HA Options") CongressHAGroup = [ diff --git a/congress_tempest_plugin/plugin.py b/congress_tempest_plugin/plugin.py index abca75a..ec7da7d 100644 --- a/congress_tempest_plugin/plugin.py +++ b/congress_tempest_plugin/plugin.py @@ -34,6 +34,8 @@ class CongressTempestPlugin(plugins.TempestPlugin): config.register_opt_group(conf, config_congress.service_available_group, config_congress.ServiceAvailableGroup) + config.register_opt_group(conf, config_congress.congress_feature_group, + config_congress.CongressFeatureGroup) config.register_opt_group(conf, config_congress.congressha_group, config_congress.CongressHAGroup) config.register_opt_group(conf, config_congress.congressz3_group, @@ -46,5 +48,7 @@ class CongressTempestPlugin(plugins.TempestPlugin): (config_congress.congressz3_group.name, config_congress.CongressZ3Group), (config_congress.service_available_group.name, - config_congress.ServiceAvailableGroup) + config_congress.ServiceAvailableGroup), + (config_congress.congress_feature_group.name, + config_congress.CongressFeatureGroup), ] diff --git a/congress_tempest_plugin/tests/scenario/congress_datasources/test_monasca.py b/congress_tempest_plugin/tests/scenario/congress_datasources/test_monasca.py index 3c05ffe..e6be811 100644 --- a/congress_tempest_plugin/tests/scenario/congress_datasources/test_monasca.py +++ b/congress_tempest_plugin/tests/scenario/congress_datasources/test_monasca.py @@ -48,6 +48,14 @@ class TestMonascaDriver(manager_congress.ScenarioPolicyBase): class TestMonascaWebhookDriver(manager_congress.ScenarioPolicyBase): + + @classmethod + def skip_checks(cls): + super(TestMonascaWebhookDriver, cls).skip_checks() + if not CONF.congress_feature_enabled.monasca_webhook: + msg = ("feature not available in this congress version") + raise cls.skipException(msg) + def setUp(self): super(TestMonascaWebhookDriver, self).setUp() monasca_setting = { diff --git a/congress_tempest_plugin/tests/scenario/congress_datasources/test_nova.py b/congress_tempest_plugin/tests/scenario/congress_datasources/test_nova.py index c36728d..fd89098 100644 --- a/congress_tempest_plugin/tests/scenario/congress_datasources/test_nova.py +++ b/congress_tempest_plugin/tests/scenario/congress_datasources/test_nova.py @@ -41,6 +41,14 @@ class TestNovaDriver(manager_congress.ScenarioPolicyBase): cls.enabled = False raise cls.skipException(msg) + if not CONF.congress_feature_enabled.nova_driver: + # queens flag for skipping nova driver tests because + # congress nova driver in queens does not work with the new + # novaclient 10.1.0 now part of upper-constraints + # https://review.openstack.org/#/c/571540/ + msg = 'Nova driver not available.' + raise cls.skipException(msg) + def setUp(self): super(TestNovaDriver, self).setUp() self.keypairs = {} diff --git a/congress_tempest_plugin/tests/scenario/congress_datasources/test_vitrage.py b/congress_tempest_plugin/tests/scenario/congress_datasources/test_vitrage.py index a913152..8107fa0 100644 --- a/congress_tempest_plugin/tests/scenario/congress_datasources/test_vitrage.py +++ b/congress_tempest_plugin/tests/scenario/congress_datasources/test_vitrage.py @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from tempest import config from tempest.lib.common.utils import test_utils from tempest.lib import decorators from tempest.lib import exceptions @@ -22,7 +23,18 @@ from congress_tempest_plugin.tests.scenario import helper from congress_tempest_plugin.tests.scenario import manager_congress +CONF = config.CONF + + class TestVitrageDriver(manager_congress.ScenarioPolicyBase): + + @classmethod + def skip_checks(cls): + super(TestVitrageDriver, cls).skip_checks() + if not CONF.congress_feature_enabled.vitrage_webhook: + msg = ("feature not available in this congress version") + raise cls.skipException(msg) + def setUp(self): super(TestVitrageDriver, self).setUp() vitrage_setting = { diff --git a/congress_tempest_plugin/tests/scenario/test_congress_basic_ops.py b/congress_tempest_plugin/tests/scenario/test_congress_basic_ops.py index 065bc07..880c9a3 100644 --- a/congress_tempest_plugin/tests/scenario/test_congress_basic_ops.py +++ b/congress_tempest_plugin/tests/scenario/test_congress_basic_ops.py @@ -14,6 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. +import testtools import time from tempest.common import utils @@ -134,6 +135,12 @@ class TestPolicyBasicOps(manager_congress.ScenarioPolicyBase): @decorators.attr(type='smoke') @utils.services('compute', 'network') + @testtools.skipUnless(CONF.congress_feature_enabled.nova_driver, + 'Test involving Nova driver skipped for queens.') + # queens flag for skipping nova driver tests because + # congress nova driver in queens does not work with the new + # novaclient 10.1.0 now part of upper-constraints + # https://review.openstack.org/#/c/571540/ def test_reactive_enforcement(self): servers_client = self.os_admin.servers_client server_name = 'server_under_test'