From 8b0d80d556dfd7935b6464ec76b49c9c0e6249e0 Mon Sep 17 00:00:00 2001 From: xudan Date: Fri, 23 Mar 2018 00:03:58 -0400 Subject: Support to specify docker image for each test case 1. Currently each type of test cases will use one docker image. 2. For example, Functest test cases use opnfv/functest-restapi:euphrates Yardstick uses opnfv/yardstick:opnfv-5.1.0 3. It needs to support to specify the docker image for each test case. 4. For example, vping test cases use opnfv/functest-smoke:euphrates sdnvpn uses opnfv/functest-features:euphrates 5. The benefit of this is that these docker images are well verified by Functest CI and from Functest plan, they may not support functest-restapi docker image in its future release. JIRA: DOVETAIL-638 Change-Id: I8a30eea2233aeff809af2e241b6c939194397832 Signed-off-by: xudan --- dovetail/test_runner.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'dovetail/test_runner.py') diff --git a/dovetail/test_runner.py b/dovetail/test_runner.py index 26b85a1e..b059047f 100644 --- a/dovetail/test_runner.py +++ b/dovetail/test_runner.py @@ -51,14 +51,15 @@ class DockerRunner(object): return dest_path def run(self): + docker_image = Container.get_docker_image(self.testcase) if dt_cfg.dovetail_config['offline']: - exist = Container.check_image_exist(self.testcase.validate_type()) + exist = Container.get_image_id(docker_image) if not exist: self.logger.error("{} image doesn't exist, can't run offline." .format(self.testcase.validate_type())) return else: - if not Container.pull_image(self.testcase.validate_type()): + if not Container.pull_image(docker_image): self.logger.error("Failed to pull the image.") return # for sdnvpn, there is a need to download needed images to config_dir @@ -71,7 +72,7 @@ class DockerRunner(object): self.logger.error('Image {} not found.'.format(img_name)) return container_id = Container.create(self.testcase.validate_type(), - self.testcase.name()) + self.testcase.name(), docker_image) if not container_id: self.logger.error('Failed to create container.') return -- cgit 1.2.3-korg