summaryrefslogtreecommitdiffstats
path: root/dovetail
diff options
context:
space:
mode:
authorGeorg Kunz <georg.kunz@ericsson.com>2018-04-01 11:35:09 +0200
committerGeorg Kunz <georg.kunz@ericsson.com>2018-04-17 19:14:14 +0000
commit749946dcc5b17cfca43c6e8692359f4972e48b21 (patch)
treebbfb42c881e4e2cb5947b6fb15e0b0fa095651c7 /dovetail
parent71ba21ff906d4104a81442d4712aac13cf4906d4 (diff)
Implementation of API validaton exemption in dovetail
This patch adds the ability to Dovetail to disable strict API response validation in Tempest-based test cases run by Functest. Corresponding updates of the web portal and backporting of this patch to OVP 1.0.0 (Danube) will follow. JIRA: DOVETAIL-633 Change-Id: Iace99ea1b6224ea907a2c3af8676e9285e6ad3ee Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
Diffstat (limited to 'dovetail')
-rw-r--r--dovetail/constants.py2
-rwxr-xr-xdovetail/run.py10
-rw-r--r--dovetail/testcase.py19
3 files changed, 28 insertions, 3 deletions
diff --git a/dovetail/constants.py b/dovetail/constants.py
index c3ce615e..00203f53 100644
--- a/dovetail/constants.py
+++ b/dovetail/constants.py
@@ -11,7 +11,7 @@ import os.path
DOVETAIL_CONF_PATH = '/etc/dovetail'
USERCONF_PATH = os.path.join(DOVETAIL_CONF_PATH, 'userconfig')
-PATCH_PATH = os.path.join(DOVETAIL_CONF_PATH, 'patch')
+PATCH_PATH = os.path.join(DOVETAIL_CONF_PATH, 'patches')
CONF_PATH = os.path.join(DOVETAIL_CONF_PATH, 'conf')
TESTCASE_PATH = os.path.join(DOVETAIL_CONF_PATH, 'testcase')
COMPLIANCE_PATH = os.path.join(DOVETAIL_CONF_PATH, 'compliance')
diff --git a/dovetail/run.py b/dovetail/run.py
index 13e365c9..731d84d2 100755
--- a/dovetail/run.py
+++ b/dovetail/run.py
@@ -220,7 +220,7 @@ def get_result_path():
dt_cfg.dovetail_config['images_dir'] = os.path.join(dovetail_home,
'images')
pre_config_path = os.path.join(dovetail_home, 'pre_config')
- patch_set_path = os.path.join(dovetail_home, 'patch')
+ patch_set_path = os.path.join(dovetail_home, 'patches')
dt_cfg.dovetail_config['config_dir'] = pre_config_path
dt_cfg.dovetail_config['patch_dir'] = patch_set_path
return dovetail_home
@@ -238,7 +238,7 @@ def copy_patch_files(logger):
patch_set_path = dt_cfg.dovetail_config['patch_dir']
if not os.path.isdir(patch_set_path):
os.makedirs(patch_set_path)
- cmd = 'sudo cp -r %s/* %s' % (constants.PATCH_PATH, patch_set_path)
+ cmd = 'sudo cp -a -r %s/* %s' % (constants.PATCH_PATH, patch_set_path)
dt_utils.exec_cmd(cmd, logger, exit_on_error=False)
@@ -303,6 +303,12 @@ def main(*args, **kwargs):
else:
dt_cfg.dovetail_config['offline'] = False
+ if kwargs['no_api_validation']:
+ dt_cfg.dovetail_config['no_api_validation'] = True
+ logger.warning('Strict API response validation DISABLED.')
+ else:
+ dt_cfg.dovetail_config['no_api_validation'] = False
+
dt_utils.get_hardware_info(logger)
origin_testarea = kwargs['testarea']
diff --git a/dovetail/testcase.py b/dovetail/testcase.py
index 86f8061d..866c33b8 100644
--- a/dovetail/testcase.py
+++ b/dovetail/testcase.py
@@ -289,6 +289,25 @@ class FunctestTestcase(Testcase):
super(FunctestTestcase, self).__init__(testcase_yaml)
self.type = 'functest'
+ def prepare_cmd(self, test_type):
+ if not super(FunctestTestcase, self).prepare_cmd(test_type):
+ return False
+
+ # if API validation is disabled, append a command for applying a
+ # patch inside the functest container
+ if dt_cfg.dovetail_config['no_api_validation']:
+ patch_cmd = os.path.join(
+ dt_cfg.dovetail_config['functest']['config']['dir'],
+ 'patches',
+ 'functest',
+ 'disable-api-validation',
+ 'apply.sh')
+ self.cmds = [patch_cmd] + self.cmds
+ self.logger.debug('Updated list of commands for test run with '
+ 'disabled API response validation: {}'
+ .format(self.cmds))
+ return True
+
class YardstickTestcase(Testcase):