blob: 18548fb30223b290f02e65fb91bfe1bf86d52c29 [file] [log] [blame]
Dennis Dmitriev6f59add2016-10-18 13:45:27 +03001# 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.
14import os
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030015import time
16
17_boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True,
18 '0': False, 'no': False, 'false': False, 'off': False}
19
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030020
21def get_var_as_bool(name, default):
22 value = os.environ.get(name, '')
23 return _boolean_states.get(value.lower(), default)
24
25
26LOGS_DIR = os.environ.get('LOGS_DIR', os.getcwd())
Dennis Dmitriev27007322019-05-03 19:21:44 +030027LOG_NAME = os.environ.get('LOG_NAME', 'tests.log')
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030028TIMESTAT_PATH_YAML = os.environ.get(
29 'TIMESTAT_PATH_YAML', os.path.join(
30 LOGS_DIR, 'timestat_{}.yaml'.format(time.strftime("%Y%m%d"))))
31
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +030032VIRTUAL_ENV = os.environ.get("VIRTUAL_ENV", None)
33ENV_NAME = os.environ.get("ENV_NAME", None)
Dennis Dmitriev411dd102017-09-15 16:04:47 +030034MAKE_SNAPSHOT_STAGES = get_var_as_bool("MAKE_SNAPSHOT_STAGES", True)
35SHUTDOWN_ENV_ON_TEARDOWN = get_var_as_bool('SHUTDOWN_ENV_ON_TEARDOWN', True)
Hanna Arhipova31cb1d82021-01-27 09:41:11 +020036DEPLOY_EMPTY_NODE = get_var_as_bool('DEPLOY_EMPTY_NODE', False)
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +030037
Dennis Dmitriev2a13a132016-11-04 00:56:23 +020038LAB_CONFIG_NAME = os.environ.get('LAB_CONFIG_NAME', 'mk22-lab-basic')
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030039DOMAIN_NAME = os.environ.get('DOMAIN_NAME',
40 '{}.local'.format(LAB_CONFIG_NAME))
Dina Belovae6fdffb2017-09-19 13:58:34 -070041# LAB_CONFIGS_NAME = os.environ.get('LAB_NAME', 'mk22-lab-advanced')
Dennis Dmitriev2a13a132016-11-04 00:56:23 +020042
Dennis Dmitriev95126792016-10-18 17:03:30 +030043SSH_LOGIN = os.environ.get('SSH_LOGIN', 'root')
44SSH_PASSWORD = os.environ.get('SSH_PASSWORD', 'r00tme')
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030045SSH_NODE_CREDENTIALS = {"login": SSH_LOGIN,
46 "password": SSH_PASSWORD}
47
Dennis Dmitrievd2604512018-06-04 05:34:44 +030048# http://docs.paramiko.org/en/2.4/api/transport.html\
49# #paramiko.transport.Transport.set_keepalive
50# If this is set, after interval seconds without sending any data over the
51# connection, a "keepalive" packet will be sent (and ignored by the remote
52# host). Similar to ServerAliveInterval for ssh_config.
53# '0' to disable keepalives.
54SSH_SERVER_ALIVE_INTERVAL = int(
55 os.environ.get('SSH_SERVER_ALIVE_INTERVAL', 60))
56
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030057# public_iface = IFACES[0]
58# private_iface = IFACES[1]
59IFACES = [
60 os.environ.get("IFACE_0", "eth0"),
61 os.environ.get("IFACE_1", "eth1"),
62]
Dmitry Tyzhnenko2b730a02017-04-07 19:31:32 +030063
64SALT_USER = os.environ.get('SALT_USER', 'salt')
65SALT_PASSWORD = os.environ.get('SALT_PASSWORD', 'hovno12345!')
Artem Panchenkoedf70ef2017-06-13 09:14:34 +030066
67DOCKER_REGISTRY = os.environ.get('DOCKER_REGISTRY',
Dennis Dmitriev257a9382018-02-15 04:00:46 +020068 'docker-prod-local.artifactory.mirantis.com')
Victor Ryzhenkine784bbf2018-12-21 03:58:00 +040069BINARY_REGISTRY = os.environ.get('BINARY_REGISTRY', 'https://'
70 'docker-prod-local.artifactory.mirantis.com/'
71 'artifactory/binary-prod-local')
ibumarskoved91a0d2017-11-21 10:17:53 +030072DOCKER_NAME = os.environ.get('DOCKER_NAME',
73 'mirantis/oscore/rally-tempest:latest')
Dennis Dmitriev257a9382018-02-15 04:00:46 +020074DOCKER_IMAGES_SL_TAG = os.environ.get('DOCKER_IMAGES_SL_TAG', 'latest')
Tatyana Leontovichf8ec90d2017-07-18 16:36:16 +030075
Tatyana Leontovich53bd1f92017-09-08 13:04:42 +030076PATTERN = os.environ.get('PATTERN', None)
77RUN_TEMPEST = get_var_as_bool('RUN_TEMPEST', False)
sgudzf5a51222018-05-11 14:20:50 +030078RUN_SL_TESTS = get_var_as_bool('RUN_SL_TESTS', False)
Dmitry Tyzhnenkoc56b77e2018-05-21 11:01:43 +030079
80TEMPEST_IMAGE = os.environ.get(
81 'TEMPEST_IMAGE',
82 'docker-prod-virtual.docker.mirantis.net/mirantis/cicd/ci-tempest') # noqa
Oleksii Butenko71d76f32018-06-05 17:46:34 +030083TEMPEST_IMAGE_VERSION = os.environ.get('TEMPEST_IMAGE_VERSION', 'pike')
Dmitry Tyzhnenkoc56b77e2018-05-21 11:01:43 +030084TEMPEST_PATTERN = os.environ.get('TEMPEST_PATTERN', 'tempest')
Tatyana Leontovich1e063f02019-05-08 15:06:33 +030085TEMPEST_TIMEOUT = int(os.environ.get('TEMPEST_TIMEOUT', 60 * 60 * 10))
Oleksii Zhurba302818d2019-06-03 11:20:52 -050086TEMPEST_THREADS = int(os.environ.get('TEMPEST_THREADS', 4))
Oleksii Butenko25a8f372019-03-22 17:25:47 +020087TEMPEST_EXTRA_ARGS = os.environ.get('TEMPEST_EXTRA_ARGS', '')
Oleksii Butenkoe82441d2018-06-12 16:01:33 +030088TEMPEST_TARGET = os.environ.get('TEMPEST_TARGET', 'gtw01')
Tatyana Leontovich14e201d2018-07-05 13:28:54 +030089SALT_VERSION = os.environ.get('SALT_VERSION', '2017.7')
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030090
Dennis Dmitrieva51b89d2019-03-05 21:49:07 +020091# REPOSITORY_SUITE is always defined in swarm-run-pytest from MCP_VERSION
92REPOSITORY_SUITE = os.environ.get('REPOSITORY_SUITE', 'proposed')
93MCP_VERSION = os.environ.get('MCP_VERSION', REPOSITORY_SUITE)
94
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030095SL_TEST_REPO = os.environ.get('SL_TEST_REPO',
96 'https://github.com/Mirantis/stacklight-pytest')
97SL_TEST_COMMIT = os.environ.get('SL_TEST_COMMIT', 'master')
Dennis Dmitrievb6bcc5c2018-09-26 11:07:53 +000098
99EXTERNAL_ADDRESS_POOL_NAME = os.environ.get('EXTERNAL_ADDRESS_POOL_NAME',
100 'external-pool01')
Dmitry Tyzhnenko80ce0202019-02-07 13:27:19 +0200101
102STACK_INSTALL = os.environ.get('STACK_INSTALL', None)
Hanna Arhipova6f493522019-12-25 04:23:28 +0200103BATCH_SIZE = os.environ.get('BATCH_SIZE', None)
Dmitriy Kruglov758f99c2020-02-04 12:04:31 +0100104DIST_UPGRADE_NODES = os.environ.get('DIST_UPGRADE_NODES', False)
PGlazoved19b352020-05-21 16:42:27 +0400105UPGRADE_SALTSTACK = os.environ.get('UPGRADE_SALTSTACK', False)
Dmitry Tyzhnenko80ce0202019-02-07 13:27:19 +0200106SKIP_SYNC_TIME = get_var_as_bool("SKIP_SYNC_TIME", False)
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +0200107
108# OpenStack parameters to work with Heat stacks
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +0200109OS_HEAT_VERSION = os.environ.get('OS_HEAT_VERSION', 1)
110OS_AUTH_URL = os.environ.get('OS_AUTH_URL', None)
111OS_USERNAME = os.environ.get('OS_USERNAME', None)
112OS_PASSWORD = os.environ.get('OS_PASSWORD', None)
113OS_PROJECT_NAME = os.environ.get('OS_PROJECT_NAME', None)
Dennis Dmitrievc902ad82019-04-12 13:41:30 +0300114OS_USER_DOMAIN_NAME = os.environ.get('OS_USER_DOMAIN_NAME', 'Default')
115LAB_PARAM_DEFAULTS = os.environ.get('LAB_PARAM_DEFAULTS', '')