# Path: sahara_tempest_plugin/tests/clients/base.py
# TEMPEST_CONF = config.CONF
# CLUSTER_STATUS_ACTIVE = "Active"
# CLUSTER_STATUS_ERROR = "Error"
# class ClusterErrorException(exceptions.TempestException):
# class BaseDataProcessingTest(tempest.test.BaseTestCase):
#     def resource_setup(cls):
#     def get_floating_ip_pool_id_for_neutron(cls):
#     def get_private_network_id(cls):
#     def _find_network_by_name(cls, network_name):
#     def get_image_id(cls, image_name):
#     def get_plugin(cls):
#     def create_node_group_template(self, name, **kwargs):
#     def create_cluster_template(self, name, **kwargs):
#     def create_data_source(self, name, url, description, type,
#                            credentials=None):
#     def create_job_binary(self, name, url, description, extra=None):
#     def create_job_binary_internal(self, name, data):
#     def create_job(self, name, job_type, mains, libs=None, description=None):
#     def create_cluster(self, name, **kwargs):
#     def check_cluster_active(self, cluster_id):
#     def create_job_execution(self, **kwargs):
#     def create_container(self, name):
#     def delete_resource(self, resource_client, resource_id):
#     def delete_timeout(
#             self, resource_client, resource_id,
#             timeout=TEMPEST_CONF.data_processing.cluster_timeout):
#     def delete_swift_container(self, container):


import time
from testtools import testcase as tc
from oslo_utils import timeutils
from saharaclient.api import base as sab
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions
from sahara_tempest_plugin.tests.clients import base
        # create swift container
        container_name = data_utils.rand_name('test-container')
        self.create_container(container_name)

        # create input data source
        input_file_name = data_utils.rand_name('input')
        self.object_client.create_object(container_name, input_file_name,
                                         'some-data')

        input_file_url = 'swift://%s/%s' % (container_name, input_file_name)
        input_source_name = data_utils.rand_name('input-data-source')
        input_source = self.create_data_source(
            input_source_name, input_file_url, '', 'swift',
            {'user': 'test', 'password': '123'})

        # create output data source
        output_dir_name = data_utils.rand_name('output')
        output_dir_url = 'swift://%s/%s' % (container_name, output_dir_name)
        output_source_name = data_utils.rand_name('output-data-source')
        output_source = self.create_data_source(
            output_source_name, output_dir_url, '', 'swift',
            {'user': 'test', 'password': '123'})

        job_binary = {
            'name': data_utils.rand_name('sahara-job-binary'),
            'url': input_file_url,
            'description': 'Test job binary',
            'extra': {
                'user': 'test',
                'password': '123'

# Path: sahara_tempest_plugin/tests/clients/base.py
# TEMPEST_CONF = config.CONF
# CLUSTER_STATUS_ACTIVE = "Active"
# CLUSTER_STATUS_ERROR = "Error"
# class ClusterErrorException(exceptions.TempestException):
# class BaseDataProcessingTest(tempest.test.BaseTestCase):
#     def resource_setup(cls):
#     def get_floating_ip_pool_id_for_neutron(cls):
#     def get_private_network_id(cls):
#     def _find_network_by_name(cls, network_name):
#     def get_image_id(cls, image_name):
#     def get_plugin(cls):
#     def create_node_group_template(self, name, **kwargs):
#     def create_cluster_template(self, name, **kwargs):
#     def create_data_source(self, name, url, description, type,
#                            credentials=None):
#     def create_job_binary(self, name, url, description, extra=None):
#     def create_job_binary_internal(self, name, data):
#     def create_job(self, name, job_type, mains, libs=None, description=None):
#     def create_cluster(self, name, **kwargs):
#     def check_cluster_active(self, cluster_id):
#     def create_job_execution(self, **kwargs):
#     def create_container(self, name):
#     def delete_resource(self, resource_client, resource_id):
#     def delete_timeout(
#             self, resource_client, resource_id,
#             timeout=TEMPEST_CONF.data_processing.cluster_timeout):
#     def delete_swift_container(self, container):


# Path: sahara_tempest_plugin/tests/clients/test_job_executions.py
import time
from testtools import testcase as tc
from oslo_utils import timeutils
from saharaclient.api import base as sab
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions
from sahara_tempest_plugin.tests.clients import base

        # create swift container
        container_name = data_utils.rand_name('test-container')
        self.create_container(container_name)

        # create input data source
        input_file_name = data_utils.rand_name('input')
        self.object_client.create_object(container_name, input_file_name,
                                         'some-data')

        input_file_url = 'swift://%s/%s' % (container_name, input_file_name)
        input_source_name = data_utils.rand_name('input-data-source')
        input_source = self.create_data_source(
            input_source_name, input_file_url, '', 'swift',
            {'user': 'test', 'password': '123'})

        # create output data source
        output_dir_name = data_utils.rand_name('output')
        output_dir_url = 'swift://%s/%s' % (container_name, output_dir_name)
        output_source_name = data_utils.rand_name('output-data-source')
        output_source = self.create_data_source(
            output_source_name, output_dir_url, '', 'swift',
            {'user': 'test', 'password': '123'})

        job_binary = {
            'name': data_utils.rand_name('sahara-job-binary'),
            'url': input_file_url,
            'description': 'Test job binary',
            'extra': {
                'user': 'test',
                'password': '123'

            }