summaryrefslogtreecommitdiffstats
path: root/dovetail/conf/dovetail_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'dovetail/conf/dovetail_config.py')
-rw-r--r--dovetail/conf/dovetail_config.py31
1 files changed, 12 insertions, 19 deletions
diff --git a/dovetail/conf/dovetail_config.py b/dovetail/conf/dovetail_config.py
index 14dc59a3..d812c5c9 100644
--- a/dovetail/conf/dovetail_config.py
+++ b/dovetail/conf/dovetail_config.py
@@ -14,15 +14,14 @@ import re
class DovetailConfig:
- COMPLIANCE_PATH = './compliance/'
- TESTCASE_PATH = './testcase/'
- # testsuite supported tuple, should adjust accordingly
- testsuite_supported = ('compliance_set', 'proposed_tests', 'debug')
- # testarea supported tuple, should adjust accordingly
- testarea_supported = ('vimops', 'nfvi', 'ipv6')
-
dovetail_config = {}
+ CMD_NAME_TRANS = {
+ 'SUT_TYPE': 'INSTALLER_TYPE',
+ 'SUT_IP': 'INSTALLER_IP',
+ 'CON_DEBUG': 'CI_DEBUG',
+ }
+
@classmethod
def load_config_files(cls):
curr_path = os.path.dirname(os.path.abspath(__file__))
@@ -42,11 +41,7 @@ class DovetailConfig:
@classmethod
def cmd_name_trans(cls, cmd_name):
key = cmd_name.upper()
- if key == 'SUT_TYPE':
- key = 'INSTALLER_TYPE'
- if key == 'SUT_IP':
- key = 'INSTALLER_IP'
- return key
+ return cls.CMD_NAME_TRANS.get(key, key)
@classmethod
def update_envs(cls, options):
@@ -55,18 +50,16 @@ class DovetailConfig:
if not options[item] and key in os.environ:
options[item] = os.environ[key]
if options[item]:
- cls.update_config_envs('functest', key)
- cls.update_config_envs('yardstick', key)
+ cls.update_config_envs('functest', key, options[item])
+ cls.update_config_envs('yardstick', key, options[item])
@classmethod
- def update_config_envs(cls, script_type, key):
- if key == 'DEBUG':
- os.environ['CI_DEBUG'] = os.environ[key]
+ def update_config_envs(cls, script_type, key, value):
envs = cls.dovetail_config[script_type]['envs']
old_value = re.findall(r'\s+%s=(.*?)(\s+|$)' % key, envs)
if old_value == []:
- envs += ' -e ' + key + '=' + os.environ[key]
+ envs += ' -e ' + key + '=' + value
else:
- envs = envs.replace(old_value[0][0], os.environ[key])
+ envs = envs.replace(old_value[0][0], value)
cls.dovetail_config[script_type]['envs'] = envs
return envs