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'
|
_interface = 'json'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def resource_setup(cls):
|
||||||
super(BaseDataProcessingTest, cls).setUpClass()
|
super(BaseDataProcessingTest, cls).resource_setup()
|
||||||
if not CONF.service_available.sahara:
|
if not CONF.service_available.sahara:
|
||||||
raise cls.skipException('Sahara support is required')
|
raise cls.skipException('Sahara support is required')
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class BaseDataProcessingTest(tempest.test.BaseTestCase):
|
||||||
cls._jobs = []
|
cls._jobs = []
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def resource_cleanup(cls):
|
||||||
cls.cleanup_resources(getattr(cls, '_cluster_templates', []),
|
cls.cleanup_resources(getattr(cls, '_cluster_templates', []),
|
||||||
cls.client.delete_cluster_template)
|
cls.client.delete_cluster_template)
|
||||||
cls.cleanup_resources(getattr(cls, '_node_group_templates', []),
|
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.cleanup_resources(getattr(cls, '_data_sources', []),
|
||||||
cls.client.delete_data_source)
|
cls.client.delete_data_source)
|
||||||
cls.clear_isolated_creds()
|
cls.clear_isolated_creds()
|
||||||
super(BaseDataProcessingTest, cls).tearDownClass()
|
super(BaseDataProcessingTest, cls).resource_cleanup()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def cleanup_resources(resource_id_list, method):
|
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
|
sahara/restapi/rest_api_v1.0.html#cluster-templates
|
||||||
"""
|
"""
|
||||||
@classmethod
|
@classmethod
|
||||||
@test.safe_setup
|
def resource_setup(cls):
|
||||||
def setUpClass(cls):
|
super(ClusterTemplateTest, cls).resource_setup()
|
||||||
super(ClusterTemplateTest, cls).setUpClass()
|
|
||||||
# create node group template
|
# create node group template
|
||||||
node_group_template = {
|
node_group_template = {
|
||||||
'name': data_utils.rand_name('sahara-ng-template'),
|
'name': data_utils.rand_name('sahara-ng-template'),
|
||||||
|
|
|
@ -19,8 +19,8 @@ from tempest import test
|
||||||
|
|
||||||
class DataSourceTest(dp_base.BaseDataProcessingTest):
|
class DataSourceTest(dp_base.BaseDataProcessingTest):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def resource_setup(cls):
|
||||||
super(DataSourceTest, cls).setUpClass()
|
super(DataSourceTest, cls).resource_setup()
|
||||||
cls.swift_data_source_with_creds = {
|
cls.swift_data_source_with_creds = {
|
||||||
'url': 'swift://sahara-container.sahara/input-source',
|
'url': 'swift://sahara-container.sahara/input-source',
|
||||||
'description': 'Test data source',
|
'description': 'Test data source',
|
||||||
|
|
|
@ -22,9 +22,8 @@ class JobBinaryTest(dp_base.BaseDataProcessingTest):
|
||||||
sahara/restapi/rest_api_v1.1_EDP.html#job-binaries
|
sahara/restapi/rest_api_v1.1_EDP.html#job-binaries
|
||||||
"""
|
"""
|
||||||
@classmethod
|
@classmethod
|
||||||
@test.safe_setup
|
def resource_setup(cls):
|
||||||
def setUpClass(cls):
|
super(JobBinaryTest, cls).resource_setup()
|
||||||
super(JobBinaryTest, cls).setUpClass()
|
|
||||||
cls.swift_job_binary_with_extra = {
|
cls.swift_job_binary_with_extra = {
|
||||||
'url': 'swift://sahara-container.sahara/example.jar',
|
'url': 'swift://sahara-container.sahara/example.jar',
|
||||||
'description': 'Test job binary',
|
'description': 'Test job binary',
|
||||||
|
|
|
@ -22,8 +22,8 @@ class JobBinaryInternalTest(dp_base.BaseDataProcessingTest):
|
||||||
sahara/restapi/rest_api_v1.1_EDP.html#job-binary-internals
|
sahara/restapi/rest_api_v1.1_EDP.html#job-binary-internals
|
||||||
"""
|
"""
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def resource_setup(cls):
|
||||||
super(JobBinaryInternalTest, cls).setUpClass()
|
super(JobBinaryInternalTest, cls).resource_setup()
|
||||||
cls.job_binary_internal_data = 'Some script may be data'
|
cls.job_binary_internal_data = 'Some script may be data'
|
||||||
|
|
||||||
def _create_job_binary_internal(self, binary_name=None):
|
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
|
sahara/restapi/rest_api_v1.1_EDP.html#jobs
|
||||||
"""
|
"""
|
||||||
@classmethod
|
@classmethod
|
||||||
@test.safe_setup
|
def resource_setup(cls):
|
||||||
def setUpClass(cls):
|
super(JobTest, cls).resource_setup()
|
||||||
super(JobTest, cls).setUpClass()
|
|
||||||
# create job binary
|
# create job binary
|
||||||
job_binary = {
|
job_binary = {
|
||||||
'name': data_utils.rand_name('sahara-job-binary'),
|
'name': data_utils.rand_name('sahara-job-binary'),
|
||||||
|
|
|
@ -19,8 +19,8 @@ from tempest import test
|
||||||
|
|
||||||
class NodeGroupTemplateTest(dp_base.BaseDataProcessingTest):
|
class NodeGroupTemplateTest(dp_base.BaseDataProcessingTest):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def resource_setup(cls):
|
||||||
super(NodeGroupTemplateTest, cls).setUpClass()
|
super(NodeGroupTemplateTest, cls).resource_setup()
|
||||||
cls.node_group_template = {
|
cls.node_group_template = {
|
||||||
'description': 'Test node group template',
|
'description': 'Test node group template',
|
||||||
'plugin_name': 'vanilla',
|
'plugin_name': 'vanilla',
|
||||||
|
|
Loading…
Reference in New Issue