From dd3bbcb9b0a624a8cb0e8b67f9ae6ea60986f7b0 Mon Sep 17 00:00:00 2001 From: Xing Zhang Date: Wed, 15 Jan 2020 14:36:31 +0800 Subject: [PATCH] Fix skipping of tests The plugin defines a 'congress' option in the '[service_available]' group but does not respect it, so if the plugin is installed but [service_available]/congress=false, the tests will still run unless blacklisted. This patch corrects the issue by defining the tempest skip_checks class method. Change-Id: I8b00f4274afcc22400a3ead9ebd7340b629454b7 --- congress_tempest_plugin/tests/scenario/manager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/congress_tempest_plugin/tests/scenario/manager.py b/congress_tempest_plugin/tests/scenario/manager.py index 23a5c9a..ff6fda8 100644 --- a/congress_tempest_plugin/tests/scenario/manager.py +++ b/congress_tempest_plugin/tests/scenario/manager.py @@ -44,6 +44,12 @@ class ScenarioTest(tempest.test.BaseTestCase): credentials = ['primary'] + @classmethod + def skip_checks(cls): + super(ScenarioTest, cls).skip_checks() + if not CONF.service_available.congress: + raise cls.skipException("Congress support is required") + @classmethod def setup_clients(cls): super(ScenarioTest, cls).setup_clients()