Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 1 | # Copyright 2016 Mirantis, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | import os |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 15 | import time |
| 16 | |
| 17 | _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True, |
| 18 | '0': False, 'no': False, 'false': False, 'off': False} |
| 19 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 20 | |
| 21 | def get_var_as_bool(name, default): |
| 22 | value = os.environ.get(name, '') |
| 23 | return _boolean_states.get(value.lower(), default) |
| 24 | |
| 25 | |
| 26 | LOGS_DIR = os.environ.get('LOGS_DIR', os.getcwd()) |
| 27 | TIMESTAT_PATH_YAML = os.environ.get( |
| 28 | 'TIMESTAT_PATH_YAML', os.path.join( |
| 29 | LOGS_DIR, 'timestat_{}.yaml'.format(time.strftime("%Y%m%d")))) |
| 30 | |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 31 | VIRTUAL_ENV = os.environ.get("VIRTUAL_ENV", None) |
| 32 | ENV_NAME = os.environ.get("ENV_NAME", None) |
Dennis Dmitriev | 411dd10 | 2017-09-15 16:04:47 +0300 | [diff] [blame] | 33 | MAKE_SNAPSHOT_STAGES = get_var_as_bool("MAKE_SNAPSHOT_STAGES", True) |
| 34 | SHUTDOWN_ENV_ON_TEARDOWN = get_var_as_bool('SHUTDOWN_ENV_ON_TEARDOWN', True) |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 35 | |
Dennis Dmitriev | 2a13a13 | 2016-11-04 00:56:23 +0200 | [diff] [blame] | 36 | LAB_CONFIG_NAME = os.environ.get('LAB_CONFIG_NAME', 'mk22-lab-basic') |
Tatyana Leontovich | 0eb5ca3 | 2018-07-13 22:05:17 +0300 | [diff] [blame] | 37 | DOMAIN_NAME = os.environ.get('DOMAIN_NAME', |
| 38 | '{}.local'.format(LAB_CONFIG_NAME)) |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 39 | # LAB_CONFIGS_NAME = os.environ.get('LAB_NAME', 'mk22-lab-advanced') |
Dennis Dmitriev | 2a13a13 | 2016-11-04 00:56:23 +0200 | [diff] [blame] | 40 | |
Dennis Dmitriev | 9512679 | 2016-10-18 17:03:30 +0300 | [diff] [blame] | 41 | SSH_LOGIN = os.environ.get('SSH_LOGIN', 'root') |
| 42 | SSH_PASSWORD = os.environ.get('SSH_PASSWORD', 'r00tme') |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 43 | SSH_NODE_CREDENTIALS = {"login": SSH_LOGIN, |
| 44 | "password": SSH_PASSWORD} |
| 45 | |
Dennis Dmitriev | d260451 | 2018-06-04 05:34:44 +0300 | [diff] [blame] | 46 | # http://docs.paramiko.org/en/2.4/api/transport.html\ |
| 47 | # #paramiko.transport.Transport.set_keepalive |
| 48 | # If this is set, after interval seconds without sending any data over the |
| 49 | # connection, a "keepalive" packet will be sent (and ignored by the remote |
| 50 | # host). Similar to ServerAliveInterval for ssh_config. |
| 51 | # '0' to disable keepalives. |
| 52 | SSH_SERVER_ALIVE_INTERVAL = int( |
| 53 | os.environ.get('SSH_SERVER_ALIVE_INTERVAL', 60)) |
| 54 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 55 | # public_iface = IFACES[0] |
| 56 | # private_iface = IFACES[1] |
| 57 | IFACES = [ |
| 58 | os.environ.get("IFACE_0", "eth0"), |
| 59 | os.environ.get("IFACE_1", "eth1"), |
| 60 | ] |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 61 | |
| 62 | SALT_USER = os.environ.get('SALT_USER', 'salt') |
| 63 | SALT_PASSWORD = os.environ.get('SALT_PASSWORD', 'hovno12345!') |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 64 | |
| 65 | DOCKER_REGISTRY = os.environ.get('DOCKER_REGISTRY', |
Dennis Dmitriev | 257a938 | 2018-02-15 04:00:46 +0200 | [diff] [blame] | 66 | 'docker-prod-local.artifactory.mirantis.com') |
Victor Ryzhenkin | e784bbf | 2018-12-21 03:58:00 +0400 | [diff] [blame] | 67 | BINARY_REGISTRY = os.environ.get('BINARY_REGISTRY', 'https://' |
| 68 | 'docker-prod-local.artifactory.mirantis.com/' |
| 69 | 'artifactory/binary-prod-local') |
ibumarskov | ed91a0d | 2017-11-21 10:17:53 +0300 | [diff] [blame] | 70 | DOCKER_NAME = os.environ.get('DOCKER_NAME', |
| 71 | 'mirantis/oscore/rally-tempest:latest') |
Dennis Dmitriev | 257a938 | 2018-02-15 04:00:46 +0200 | [diff] [blame] | 72 | DOCKER_IMAGES_SL_TAG = os.environ.get('DOCKER_IMAGES_SL_TAG', 'latest') |
Tatyana Leontovich | f8ec90d | 2017-07-18 16:36:16 +0300 | [diff] [blame] | 73 | |
Tatyana Leontovich | 53bd1f9 | 2017-09-08 13:04:42 +0300 | [diff] [blame] | 74 | PATTERN = os.environ.get('PATTERN', None) |
| 75 | RUN_TEMPEST = get_var_as_bool('RUN_TEMPEST', False) |
sgudz | f5a5122 | 2018-05-11 14:20:50 +0300 | [diff] [blame] | 76 | RUN_SL_TESTS = get_var_as_bool('RUN_SL_TESTS', False) |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 77 | |
| 78 | TEMPEST_IMAGE = os.environ.get( |
| 79 | 'TEMPEST_IMAGE', |
| 80 | 'docker-prod-virtual.docker.mirantis.net/mirantis/cicd/ci-tempest') # noqa |
Oleksii Butenko | 71d76f3 | 2018-06-05 17:46:34 +0300 | [diff] [blame] | 81 | TEMPEST_IMAGE_VERSION = os.environ.get('TEMPEST_IMAGE_VERSION', 'pike') |
Dmitry Tyzhnenko | c56b77e | 2018-05-21 11:01:43 +0300 | [diff] [blame] | 82 | TEMPEST_PATTERN = os.environ.get('TEMPEST_PATTERN', 'tempest') |
Oleksii Butenko | 173e770 | 2018-10-24 18:31:12 +0300 | [diff] [blame] | 83 | TEMPEST_TIMEOUT = int(os.environ.get('TEMPEST_TIMEOUT', 60 * 60 * 6)) |
Oleksii Butenko | e82441d | 2018-06-12 16:01:33 +0300 | [diff] [blame] | 84 | TEMPEST_THREADS = int(os.environ.get('TEMPEST_THREADS', 2)) |
Oleksii Butenko | 25a8f37 | 2019-03-22 17:25:47 +0200 | [diff] [blame] | 85 | TEMPEST_EXTRA_ARGS = os.environ.get('TEMPEST_EXTRA_ARGS', '') |
Oleksii Butenko | e82441d | 2018-06-12 16:01:33 +0300 | [diff] [blame] | 86 | TEMPEST_TARGET = os.environ.get('TEMPEST_TARGET', 'gtw01') |
Tatyana Leontovich | 14e201d | 2018-07-05 13:28:54 +0300 | [diff] [blame] | 87 | SALT_VERSION = os.environ.get('SALT_VERSION', '2017.7') |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 88 | |
Dennis Dmitriev | a51b89d | 2019-03-05 21:49:07 +0200 | [diff] [blame] | 89 | # REPOSITORY_SUITE is always defined in swarm-run-pytest from MCP_VERSION |
| 90 | REPOSITORY_SUITE = os.environ.get('REPOSITORY_SUITE', 'proposed') |
| 91 | MCP_VERSION = os.environ.get('MCP_VERSION', REPOSITORY_SUITE) |
| 92 | |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 93 | SL_TEST_REPO = os.environ.get('SL_TEST_REPO', |
| 94 | 'https://github.com/Mirantis/stacklight-pytest') |
| 95 | SL_TEST_COMMIT = os.environ.get('SL_TEST_COMMIT', 'master') |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 96 | |
| 97 | EXTERNAL_ADDRESS_POOL_NAME = os.environ.get('EXTERNAL_ADDRESS_POOL_NAME', |
| 98 | 'external-pool01') |
Dmitry Tyzhnenko | 80ce020 | 2019-02-07 13:27:19 +0200 | [diff] [blame] | 99 | |
| 100 | STACK_INSTALL = os.environ.get('STACK_INSTALL', None) |
| 101 | SKIP_SYNC_TIME = get_var_as_bool("SKIP_SYNC_TIME", False) |
Dennis Dmitriev | f5f2e60 | 2017-11-03 15:36:19 +0200 | [diff] [blame] | 102 | |
| 103 | # OpenStack parameters to work with Heat stacks |
Dennis Dmitriev | f5f2e60 | 2017-11-03 15:36:19 +0200 | [diff] [blame] | 104 | OS_HEAT_VERSION = os.environ.get('OS_HEAT_VERSION', 1) |
| 105 | OS_AUTH_URL = os.environ.get('OS_AUTH_URL', None) |
| 106 | OS_USERNAME = os.environ.get('OS_USERNAME', None) |
| 107 | OS_PASSWORD = os.environ.get('OS_PASSWORD', None) |
| 108 | OS_PROJECT_NAME = os.environ.get('OS_PROJECT_NAME', None) |
Dennis Dmitriev | c902ad8 | 2019-04-12 13:41:30 +0300 | [diff] [blame^] | 109 | OS_USER_DOMAIN_NAME = os.environ.get('OS_USER_DOMAIN_NAME', 'Default') |
| 110 | LAB_PARAM_DEFAULTS = os.environ.get('LAB_PARAM_DEFAULTS', '') |