From 78b0062ce9dc4d23b967112a0896f12cc6526e1c Mon Sep 17 00:00:00 2001 From: xudan Date: Thu, 20 Dec 2018 01:49:22 -0500 Subject: Simplify project conf files 1. use copy commands instead of pre_copy 2. remove redundant items in project conf files 3. make the volume mapping clearer Change-Id: I6c6aa58fac65d7e40105e0a54f6544ee5c47db31 Signed-off-by: xudan --- dovetail/testcase.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'dovetail/testcase.py') diff --git a/dovetail/testcase.py b/dovetail/testcase.py index b79bcfa7..74fbbea8 100644 --- a/dovetail/testcase.py +++ b/dovetail/testcase.py @@ -136,21 +136,20 @@ class Testcase(object): return post_condition def mk_src_file(self): - testcase_src_file = self.pre_copy_path('src_file') - try: - file_path = os.path.join(dt_cfg.dovetail_config['result_dir'], - testcase_src_file) - with open(file_path, 'w+') as src_file: - if self.sub_testcase() is not None: + test_list = os.path.join(dt_cfg.dovetail_config['result_dir'], + 'tempest_custom.txt') + if self.sub_testcase() is not None: + try: + with open(test_list, 'w+') as src_file: for sub_test in self.sub_testcase(): self.logger.debug( 'Save test cases {}'.format(sub_test)) src_file.write(sub_test + '\n') - self.logger.debug('Save test cases to {}'.format(file_path)) - return file_path - except Exception: - self.logger.exception('Failed to save: {}'.format(file_path)) - return None + self.logger.debug('Save test cases to {}'.format(test_list)) + return test_list + except Exception: + self.logger.exception('Failed to save: {}'.format(test_list)) + return None def run(self): runner = TestRunnerFactory.create(self) @@ -294,8 +293,7 @@ class FunctestTestcase(Testcase): # 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', + dt_cfg.dovetail_config['functest']['patches_dir'], 'functest', 'disable-api-validation', 'apply.sh') -- cgit 1.2.3-korg