From ed7de0f59902094646ec53e0c3af192538833611 Mon Sep 17 00:00:00 2001 From: xudan Date: Tue, 23 May 2017 08:28:58 -0400 Subject: SDNVPN test cases failed in CI JIRA: DOVETAIL-439 1. SDNVPN test cases run in CI failed, because the file /home/opnfv/repos/sdnvpn/sdnvpn/test/functest/config.yaml is empty. 2. copy the file userconfig/sdnvpn_config_testcase1/2/4/8.yaml to /home/opnfv/repos/sdnvpn/sdnvpn/test/functest/config.yaml in Functest container Change-Id: Ie904f83c755efc0d9e0abe5dcd44fe4a5056123e Signed-off-by: xudan --- dovetail/test_runner.py | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'dovetail/test_runner.py') diff --git a/dovetail/test_runner.py b/dovetail/test_runner.py index cfc49018..0482c2ca 100644 --- a/dovetail/test_runner.py +++ b/dovetail/test_runner.py @@ -28,6 +28,23 @@ class DockerRunner(object): def create_log(cls): cls.logger = dt_logger.Logger(__name__ + '.DockerRunner').getLogger() + def pre_copy(self, container_id=None, dest_path=None, + src_file=None, exist_file=None): + if not dest_path: + self.logger.error("There has no dest_path in %s config file.", + self.testcase.name()) + return None + if src_file: + self.testcase.mk_src_file() + file_path = dt_cfg.dovetail_config[self.type]['result']['dir'] + src_path = os.path.join(file_path, src_file) + if exist_file: + file_path = dt_cfg.dovetail_config[self.type]['config']['dir'] + src_path = os.path.join(file_path, exist_file) + + Container.pre_copy(container_id, src_path, dest_path) + return dest_path + def run(self): if dt_cfg.dovetail_config['offline']: exist = Container.check_image_exist(self.testcase.validate_type()) @@ -47,12 +64,15 @@ class DockerRunner(object): self.logger.debug('container id:%s', container_id) - dest_path = self.testcase.pre_copy_dest_path() - if dest_path: - self.testcase.mk_src_file() - src_path = self.testcase.pre_copy_src_path(self.type) - ret, msg = Container.pre_copy(container_id, src_path, - dest_path) + dest_path = self.testcase.pre_copy_path("dest_path") + src_file_name = self.testcase.pre_copy_path("src_file") + exist_file_name = self.testcase.pre_copy_path("exist_src_file") + + if src_file_name or exist_file_name: + if not self.pre_copy(container_id, dest_path, src_file_name, + exist_file_name): + return + if not self.testcase.prepared(): prepare_failed = False cmds = self.testcase.pre_condition() -- cgit 1.2.3-korg