| # Copyright 2016 Mirantis, Inc. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| # not use this file except in compliance with the License. You may obtain |
| # a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # License for the specific language governing permissions and limitations |
| # under the License. |
| import os |
| import time |
| |
| _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True, |
| '0': False, 'no': False, 'false': False, 'off': False} |
| |
| |
| def get_var_as_bool(name, default): |
| value = os.environ.get(name, '') |
| return _boolean_states.get(value.lower(), default) |
| |
| |
| LOGS_DIR = os.environ.get('LOGS_DIR', os.getcwd()) |
| LOG_NAME = os.environ.get('LOG_NAME', 'tests.log') |
| TIMESTAT_PATH_YAML = os.environ.get( |
| 'TIMESTAT_PATH_YAML', os.path.join( |
| LOGS_DIR, 'timestat_{}.yaml'.format(time.strftime("%Y%m%d")))) |
| |
| VIRTUAL_ENV = os.environ.get("VIRTUAL_ENV", None) |
| ENV_NAME = os.environ.get("ENV_NAME", None) |
| MAKE_SNAPSHOT_STAGES = get_var_as_bool("MAKE_SNAPSHOT_STAGES", True) |
| SHUTDOWN_ENV_ON_TEARDOWN = get_var_as_bool('SHUTDOWN_ENV_ON_TEARDOWN', True) |
| DEPLOY_EMPTY_NODE = get_var_as_bool('DEPLOY_EMPTY_NODE', False) |
| |
| LAB_CONFIG_NAME = os.environ.get('LAB_CONFIG_NAME', 'mk22-lab-basic') |
| DOMAIN_NAME = os.environ.get('DOMAIN_NAME', |
| '{}.local'.format(LAB_CONFIG_NAME)) |
| # LAB_CONFIGS_NAME = os.environ.get('LAB_NAME', 'mk22-lab-advanced') |
| |
| SSH_LOGIN = os.environ.get('SSH_LOGIN', 'root') |
| SSH_PASSWORD = os.environ.get('SSH_PASSWORD', 'r00tme') |
| SSH_NODE_CREDENTIALS = {"login": SSH_LOGIN, |
| "password": SSH_PASSWORD} |
| |
| # http://docs.paramiko.org/en/2.4/api/transport.html\ |
| # #paramiko.transport.Transport.set_keepalive |
| # If this is set, after interval seconds without sending any data over the |
| # connection, a "keepalive" packet will be sent (and ignored by the remote |
| # host). Similar to ServerAliveInterval for ssh_config. |
| # '0' to disable keepalives. |
| SSH_SERVER_ALIVE_INTERVAL = int( |
| os.environ.get('SSH_SERVER_ALIVE_INTERVAL', 60)) |
| |
| # public_iface = IFACES[0] |
| # private_iface = IFACES[1] |
| IFACES = [ |
| os.environ.get("IFACE_0", "eth0"), |
| os.environ.get("IFACE_1", "eth1"), |
| ] |
| |
| SALT_USER = os.environ.get('SALT_USER', 'salt') |
| SALT_PASSWORD = os.environ.get('SALT_PASSWORD', 'hovno12345!') |
| |
| DOCKER_REGISTRY = os.environ.get('DOCKER_REGISTRY', |
| 'docker-prod-local.artifactory.mirantis.com') |
| BINARY_REGISTRY = os.environ.get('BINARY_REGISTRY', 'https://' |
| 'docker-prod-local.artifactory.mirantis.com/' |
| 'artifactory/binary-prod-local') |
| DOCKER_NAME = os.environ.get('DOCKER_NAME', |
| 'mirantis/oscore/rally-tempest:latest') |
| DOCKER_IMAGES_SL_TAG = os.environ.get('DOCKER_IMAGES_SL_TAG', 'latest') |
| THREADS = os.environ.get("THREADS", 10) |
| |
| PATTERN = os.environ.get('PATTERN', None) |
| RUN_TEMPEST = get_var_as_bool('RUN_TEMPEST', False) |
| RUN_SL_TESTS = get_var_as_bool('RUN_SL_TESTS', False) |
| |
| TEMPEST_IMAGE = os.environ.get( |
| 'TEMPEST_IMAGE', |
| 'docker-prod-virtual.docker.mirantis.net/mirantis/cicd/ci-tempest') # noqa |
| TEMPEST_IMAGE_VERSION = os.environ.get('TEMPEST_IMAGE_VERSION', 'pike') |
| TEMPEST_PATTERN = os.environ.get('TEMPEST_PATTERN', 'tempest') |
| TEMPEST_TIMEOUT = int(os.environ.get('TEMPEST_TIMEOUT', 60 * 60 * 10)) |
| TEMPEST_THREADS = int(os.environ.get('TEMPEST_THREADS', 4)) |
| TEMPEST_EXTRA_ARGS = os.environ.get('TEMPEST_EXTRA_ARGS', '') |
| TEMPEST_TARGET = os.environ.get('TEMPEST_TARGET', 'gtw01') |
| SALT_VERSION = os.environ.get('SALT_VERSION', '2017.7') |
| |
| # REPOSITORY_SUITE is always defined in swarm-run-pytest from MCP_VERSION |
| REPOSITORY_SUITE = os.environ.get('REPOSITORY_SUITE', 'proposed') |
| MCP_VERSION = os.environ.get('MCP_VERSION', REPOSITORY_SUITE) |
| |
| SL_TEST_REPO = os.environ.get('SL_TEST_REPO', |
| 'https://github.com/Mirantis/stacklight-pytest') |
| SL_TEST_COMMIT = os.environ.get('SL_TEST_COMMIT', 'master') |
| |
| EXTERNAL_ADDRESS_POOL_NAME = os.environ.get('EXTERNAL_ADDRESS_POOL_NAME', |
| 'external-pool01') |
| |
| STACK_INSTALL = os.environ.get('STACK_INSTALL', None) |
| BATCH_SIZE = os.environ.get('BATCH_SIZE', None) |
| DIST_UPGRADE_NODES = os.environ.get('DIST_UPGRADE_NODES', False) |
| UPGRADE_SALTSTACK = os.environ.get('UPGRADE_SALTSTACK', False) |
| SKIP_SYNC_TIME = get_var_as_bool("SKIP_SYNC_TIME", False) |
| |
| # OpenStack parameters to work with Heat stacks |
| OS_HEAT_VERSION = os.environ.get('OS_HEAT_VERSION', 1) |
| OS_AUTH_URL = os.environ.get('OS_AUTH_URL', None) |
| OS_USERNAME = os.environ.get('OS_USERNAME', None) |
| OS_PASSWORD = os.environ.get('OS_PASSWORD', None) |
| OS_PROJECT_NAME = os.environ.get('OS_PROJECT_NAME', None) |
| OS_USER_DOMAIN_NAME = os.environ.get('OS_USER_DOMAIN_NAME', 'Default') |
| LAB_PARAM_DEFAULTS = os.environ.get('LAB_PARAM_DEFAULTS', '') |