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/utils/dovetail_utils.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'dovetail/utils/dovetail_utils.py') diff --git a/dovetail/utils/dovetail_utils.py b/dovetail/utils/dovetail_utils.py index dc7dbafb..4a3d8528 100644 --- a/dovetail/utils/dovetail_utils.py +++ b/dovetail/utils/dovetail_utils.py @@ -408,3 +408,20 @@ def read_plain_file(file_path, logger=None): logger.exception("Failed to read file {}, exception: {}" .format(file_path, e)) return None + + +def get_value_from_dict(key_path, input_dict): + """ + Returns the value of a key in input_dict + key_path must be given in string format with dots + Example: result.dir + """ + if not isinstance(key_path, str): + return None + for key in key_path.split("."): + if not isinstance(input_dict, dict): + return None + input_dict = input_dict.get(key) + if not input_dict: + return None + return input_dict -- cgit 1.2.3-korg