summaryrefslogtreecommitdiffstats
path: root/dovetail/test_runner.py
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2017-05-23 08:28:58 -0400
committerxudan <xudan16@huawei.com>2017-05-24 00:05:26 -0400
commited7de0f59902094646ec53e0c3af192538833611 (patch)
tree31dcfaa749cc7de9ca1ad6fc1d0e7fb490c6bafe /dovetail/test_runner.py
parentbd5ff3bd10fffd84e79dad47be4d6fb7eea66d26 (diff)
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 <xudan16@huawei.com>
Diffstat (limited to 'dovetail/test_runner.py')
-rw-r--r--dovetail/test_runner.py32
1 files changed, 26 insertions, 6 deletions
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()