Fix skipping of tests
The plugin defines a 'watcher' option in the '[service_available]' group but does not respect it, so if the plugin is installed but [service_available]/watcher=false, the tests will still run unless blacklisted. This patch corrects the issue by defining the tempest skip_checks class method. Change-Id: Iba29ac0d05f56c83b3be4856ae671f9ae2d31486
This commit is contained in:
parent
55a829626f
commit
85df1a6d7a
@ -17,12 +17,15 @@
|
||||
import functools
|
||||
import time
|
||||
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest import test
|
||||
|
||||
from watcher_tempest_plugin import infra_optim_clients as clients
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class BaseInfraOptimTest(test.BaseTestCase):
|
||||
"""Base class for Infrastructure Optimization API tests."""
|
||||
@ -39,6 +42,12 @@ class BaseInfraOptimTest(test.BaseTestCase):
|
||||
'CANCELLED',
|
||||
'SUPERSEDED')
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(BaseInfraOptimTest, cls).skip_checks()
|
||||
if not CONF.service_available.watcher:
|
||||
raise cls.skipException('Watcher support is required')
|
||||
|
||||
@classmethod
|
||||
def setup_credentials(cls):
|
||||
super(BaseInfraOptimTest, cls).setup_credentials()
|
||||
|
@ -31,6 +31,12 @@ class ScenarioTest(tempest.test.BaseTestCase):
|
||||
|
||||
credentials = ['primary', 'admin']
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(ScenarioTest, cls).skip_checks()
|
||||
if not CONF.service_available.watcher:
|
||||
raise cls.skipException('Watcher support is required')
|
||||
|
||||
@classmethod
|
||||
def setup_clients(cls):
|
||||
super(ScenarioTest, cls).setup_clients()
|
||||
|
Loading…
Reference in New Issue
Block a user