Add skip_checks

When executing cyborg test cases, cyborg support is required.

Change-Id: I7a93d015caa147629df013f5c1da4dcf320fef28
This commit is contained in:
limin.lc 2021-06-02 15:52:34 +08:00
parent ff3204bdc9
commit ceb8d5d00d
10 changed files with 44 additions and 0 deletions

View File

@ -32,6 +32,12 @@ class BaseAPITest(test.BaseTestCase):
# client_manager = cyborgclient.Manager
@classmethod
def skip_checks(cls):
super(BaseAPITest, cls).skip_checks()
if not CONF.service_available.cyborg:
raise cls.skipException('Cyborg support is required')
@classmethod
def setup_clients(cls):
super(BaseAPITest, cls).setup_clients()

View File

@ -18,6 +18,10 @@ from cyborg_tempest_plugin.tests.api import base
class TestAcceleratorRequestController(base.BaseAPITest):
@classmethod
def skip_checks(cls):
super(TestAcceleratorRequestController, cls).skip_checks()
credentials = ['admin']
def test_create_accelerator_request(self):

View File

@ -22,6 +22,10 @@ from tempest import test
class AcceleratorRequestNegativeTest(base.BaseAPITest):
@classmethod
def skip_checks(cls):
super(AcceleratorRequestNegativeTest, cls).skip_checks()
credentials = ['admin']
@test.attr(type=['negative', 'gate'])

View File

@ -22,6 +22,10 @@ from tempest import test
class DeployableNegativeTest(base.BaseAPITest):
@classmethod
def skip_checks(cls):
super(DeployableNegativeTest, cls).skip_checks()
credentials = ['admin']
@test.attr(type=['negative', 'gate'])

View File

@ -18,6 +18,10 @@ from cyborg_tempest_plugin.tests.api import base
class TestDeployables(base.BaseAPITest):
@classmethod
def skip_checks(cls):
super(TestDeployables, cls).skip_checks()
credentials = ['admin']
def test_list_deployabcles(self):

View File

@ -18,6 +18,10 @@ from cyborg_tempest_plugin.tests.api import base
class TestDevice(base.BaseAPITest):
@classmethod
def skip_checks(cls):
super(TestDevice, cls).skip_checks()
credentials = ['admin']
def test_list_get_device(self):

View File

@ -19,6 +19,10 @@ from cyborg_tempest_plugin.tests.api import base
class TestDeviceProfileController(base.BaseAPITest):
@classmethod
def skip_checks(cls):
super(TestDeviceProfileController, cls).skip_checks()
credentials = ['admin']
def test_create_device_profile(self):

View File

@ -22,6 +22,10 @@ from tempest import test
class DeviceProfileNegativeTest(base.BaseAPITest):
@classmethod
def skip_checks(cls):
super(DeviceProfileNegativeTest, cls).skip_checks()
credentials = ['admin']
@test.attr(type=['negative', 'gate'])

View File

@ -39,6 +39,12 @@ class ScenarioTest(tempest.test.BaseTestCase):
credentials = ['primary', 'admin']
@classmethod
def skip_checks(cls):
super(ScenarioTest, cls).skip_checks()
if not CONF.service_available.cyborg:
raise cls.skipException('Cyborg support is required')
@classmethod
def setup_clients(cls):
super(ScenarioTest, cls).setup_clients()

View File

@ -37,6 +37,10 @@ class TestServerBasicOps(manager.ScenarioTest):
"""
@classmethod
def skip_checks(cls):
super(TestServerBasicOps, cls).skip_checks()
def setUp(self):
super(TestServerBasicOps, self).setUp()