Migrate data_processing API tests to resource_* fixtures
Partially-implements bp resource-cleanup Change-Id: Ife28fc82dfab4262147bc118ed90cb162f462510
This commit is contained in:
parent
85837df209
commit
581c39355e
@ -24,8 +24,8 @@ class BaseDataProcessingTest(tempest.test.BaseTestCase):
|
||||
_interface = 'json'
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(BaseDataProcessingTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(BaseDataProcessingTest, cls).resource_setup()
|
||||
if not CONF.service_available.sahara:
|
||||
raise cls.skipException('Sahara support is required')
|
||||
|
||||
@ -43,7 +43,7 @@ class BaseDataProcessingTest(tempest.test.BaseTestCase):
|
||||
cls._jobs = []
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
def resource_cleanup(cls):
|
||||
cls.cleanup_resources(getattr(cls, '_cluster_templates', []),
|
||||
cls.client.delete_cluster_template)
|
||||
cls.cleanup_resources(getattr(cls, '_node_group_templates', []),
|
||||
@ -56,7 +56,7 @@ class BaseDataProcessingTest(tempest.test.BaseTestCase):
|
||||
cls.cleanup_resources(getattr(cls, '_data_sources', []),
|
||||
cls.client.delete_data_source)
|
||||
cls.clear_isolated_creds()
|
||||
super(BaseDataProcessingTest, cls).tearDownClass()
|
||||
super(BaseDataProcessingTest, cls).resource_cleanup()
|
||||
|
||||
@staticmethod
|
||||
def cleanup_resources(resource_id_list, method):
|
||||
|
@ -22,9 +22,8 @@ class ClusterTemplateTest(dp_base.BaseDataProcessingTest):
|
||||
sahara/restapi/rest_api_v1.0.html#cluster-templates
|
||||
"""
|
||||
@classmethod
|
||||
@test.safe_setup
|
||||
def setUpClass(cls):
|
||||
super(ClusterTemplateTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(ClusterTemplateTest, cls).resource_setup()
|
||||
# create node group template
|
||||
node_group_template = {
|
||||
'name': data_utils.rand_name('sahara-ng-template'),
|
||||
|
@ -19,8 +19,8 @@ from tempest import test
|
||||
|
||||
class DataSourceTest(dp_base.BaseDataProcessingTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(DataSourceTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(DataSourceTest, cls).resource_setup()
|
||||
cls.swift_data_source_with_creds = {
|
||||
'url': 'swift://sahara-container.sahara/input-source',
|
||||
'description': 'Test data source',
|
||||
|
@ -22,9 +22,8 @@ class JobBinaryTest(dp_base.BaseDataProcessingTest):
|
||||
sahara/restapi/rest_api_v1.1_EDP.html#job-binaries
|
||||
"""
|
||||
@classmethod
|
||||
@test.safe_setup
|
||||
def setUpClass(cls):
|
||||
super(JobBinaryTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(JobBinaryTest, cls).resource_setup()
|
||||
cls.swift_job_binary_with_extra = {
|
||||
'url': 'swift://sahara-container.sahara/example.jar',
|
||||
'description': 'Test job binary',
|
||||
|
@ -22,8 +22,8 @@ class JobBinaryInternalTest(dp_base.BaseDataProcessingTest):
|
||||
sahara/restapi/rest_api_v1.1_EDP.html#job-binary-internals
|
||||
"""
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(JobBinaryInternalTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(JobBinaryInternalTest, cls).resource_setup()
|
||||
cls.job_binary_internal_data = 'Some script may be data'
|
||||
|
||||
def _create_job_binary_internal(self, binary_name=None):
|
||||
|
@ -22,9 +22,8 @@ class JobTest(dp_base.BaseDataProcessingTest):
|
||||
sahara/restapi/rest_api_v1.1_EDP.html#jobs
|
||||
"""
|
||||
@classmethod
|
||||
@test.safe_setup
|
||||
def setUpClass(cls):
|
||||
super(JobTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(JobTest, cls).resource_setup()
|
||||
# create job binary
|
||||
job_binary = {
|
||||
'name': data_utils.rand_name('sahara-job-binary'),
|
||||
|
@ -19,8 +19,8 @@ from tempest import test
|
||||
|
||||
class NodeGroupTemplateTest(dp_base.BaseDataProcessingTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(NodeGroupTemplateTest, cls).setUpClass()
|
||||
def resource_setup(cls):
|
||||
super(NodeGroupTemplateTest, cls).resource_setup()
|
||||
cls.node_group_template = {
|
||||
'description': 'Test node group template',
|
||||
'plugin_name': 'vanilla',
|
||||
|
Loading…
Reference in New Issue
Block a user