diff options
Diffstat (limited to 'dovetail')
-rw-r--r-- | dovetail/constants.py | 2 | ||||
-rwxr-xr-x | dovetail/run.py | 10 | ||||
-rw-r--r-- | dovetail/testcase.py | 19 |
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): |