# Path: sahara_tests/scenario/timeouts.py
# class Defaults(object):
#     def __init__(self, config):
#     def init_defaults(cls, config):
# 
# Path: sahara_tests/scenario/utils.py
# SCENARIO_RESOURCES_DIR = pkg.resource_filename(version.version_info.package,
#                                                'scenario')
# TEST_TEMPLATE_DIR = os.path.join(SCENARIO_RESOURCES_DIR, 'defaults/')
# DEFAULT_TEMPLATE_VARS = [os.path.join(TEST_TEMPLATE_DIR,
#                                       'credentials.yaml.mako'),
#                          os.path.join(TEST_TEMPLATE_DIR,
#                                       'edp.yaml.mako')]
# TEST_TEMPLATE_PATH = os.path.join(SCENARIO_RESOURCES_DIR,
#                                   'testcase.py.mako')
# DEFAULT_STESTR_CONF = os.path.join(SCENARIO_RESOURCES_DIR, 'stestr.conf')
# def rand_name(name=''):
# def run_tests(concurrency, test_dir_path):
# def create_testcase_file(testcases, credentials, network, report,
#                          use_api_v2=False):
# def get_templates_variables(files, variable_file, verbose_run, scenario_args,
#                             auth_values):
# def generate_config(files, template_variables, auth_values, verbose_run,
#                     features_list=None):
# def get_default_templates(plugin, version, release, scenario_arguments,
#                           features=None):
# def get_auth_values(cloud_config, args):
# def _merge_dicts_sections(dict_with_section, dict_for_merge, section):
# def is_template_file(config_file):
# def read_template_variables(variable_file=None, verbose=False,
#                             scenario_args=None, auth_values=None):
# def read_scenario_config(scenario_config, template_vars=None,
#                          verbose=False):
# 
# Path: sahara_tests/utils/url.py
# def url_schema_remover(url):


import functools
import logging
import os
import sys
import time
import traceback
import fixtures
import prettytable
import six
from oslo_utils import timeutils
from tempest.lib import base
from tempest.lib.common import ssh as connection
from tempest.lib import exceptions as exc
from sahara_tests.scenario import clients
from sahara_tests.scenario import timeouts
from sahara_tests.scenario import utils
from sahara_tests.utils import crypto as ssh
from sahara_tests.utils import url as utils_url
    def _get_swift_container(self):
        if not getattr(self, '__swift_container', None):
            self.__swift_container = self.__create_container(
                utils.rand_name('sahara-tests'))
        return self.__swift_container

    def _get_s3_bucket(self):
        if not getattr(self, '__s3_bucket', None):
            self.__s3_bucket = self.__create_bucket(
                utils.rand_name('sahara-tests'))
        return self.__s3_bucket

    @track_result("Cluster scaling", False)
    def check_scale(self):
        scale_ops = []
        ng_before_scale = self.sahara.get_cluster(self.cluster_id).node_groups
        scale_ops = self.testcase['scaling']

        body = {}
        for op in scale_ops:
            node_scale = op['node_group']
            if op['operation'] == 'add':
                if 'add_node_groups' not in body:
                    body['add_node_groups'] = []
                body['add_node_groups'].append({
                    'node_group_template_id':
                    self.ng_id_map.get(node_scale,
                                       self.sahara.get_node_group_template_id(
                                           node_scale)),
                    'count': op['size'],

# Path: sahara_tests/scenario/timeouts.py
# class Defaults(object):
#     def __init__(self, config):
#     def init_defaults(cls, config):
# 
# Path: sahara_tests/scenario/utils.py
# SCENARIO_RESOURCES_DIR = pkg.resource_filename(version.version_info.package,
#                                                'scenario')
# TEST_TEMPLATE_DIR = os.path.join(SCENARIO_RESOURCES_DIR, 'defaults/')
# DEFAULT_TEMPLATE_VARS = [os.path.join(TEST_TEMPLATE_DIR,
#                                       'credentials.yaml.mako'),
#                          os.path.join(TEST_TEMPLATE_DIR,
#                                       'edp.yaml.mako')]
# TEST_TEMPLATE_PATH = os.path.join(SCENARIO_RESOURCES_DIR,
#                                   'testcase.py.mako')
# DEFAULT_STESTR_CONF = os.path.join(SCENARIO_RESOURCES_DIR, 'stestr.conf')
# def rand_name(name=''):
# def run_tests(concurrency, test_dir_path):
# def create_testcase_file(testcases, credentials, network, report,
#                          use_api_v2=False):
# def get_templates_variables(files, variable_file, verbose_run, scenario_args,
#                             auth_values):
# def generate_config(files, template_variables, auth_values, verbose_run,
#                     features_list=None):
# def get_default_templates(plugin, version, release, scenario_arguments,
#                           features=None):
# def get_auth_values(cloud_config, args):
# def _merge_dicts_sections(dict_with_section, dict_for_merge, section):
# def is_template_file(config_file):
# def read_template_variables(variable_file=None, verbose=False,
#                             scenario_args=None, auth_values=None):
# def read_scenario_config(scenario_config, template_vars=None,
#                          verbose=False):
# 
# Path: sahara_tests/utils/url.py
# def url_schema_remover(url):


# Path: sahara_tests/scenario/base.py
import functools
import logging
import os
import sys
import time
import traceback
import fixtures
import prettytable
import six
from oslo_utils import timeutils
from tempest.lib import base
from tempest.lib.common import ssh as connection
from tempest.lib import exceptions as exc
from sahara_tests.scenario import clients
from sahara_tests.scenario import timeouts
from sahara_tests.scenario import utils
from sahara_tests.utils import crypto as ssh
from sahara_tests.utils import url as utils_url

    def _get_swift_container(self):
        if not getattr(self, '__swift_container', None):
            self.__swift_container = self.__create_container(
                utils.rand_name('sahara-tests'))
        return self.__swift_container

    def _get_s3_bucket(self):
        if not getattr(self, '__s3_bucket', None):
            self.__s3_bucket = self.__create_bucket(
                utils.rand_name('sahara-tests'))
        return self.__s3_bucket

    @track_result("Cluster scaling", False)
    def check_scale(self):
        scale_ops = []
        ng_before_scale = self.sahara.get_cluster(self.cluster_id).node_groups
        scale_ops = self.testcase['scaling']

        body = {}
        for op in scale_ops:
            node_scale = op['node_group']
            if op['operation'] == 'add':
                if 'add_node_groups' not in body:
                    body['add_node_groups'] = []
                body['add_node_groups'].append({
                    'node_group_template_id':
                    self.ng_id_map.get(node_scale,
                                       self.sahara.get_node_group_template_id(
                                           node_scale)),
                    'count': op['size'],

                    'name': utils.rand_name(node_scale)