diff options
author | xudan <xudan16@huawei.com> | 2018-03-23 00:03:58 -0400 |
---|---|---|
committer | Georg Kunz <georg.kunz@ericsson.com> | 2018-04-10 10:21:02 +0000 |
commit | 8b0d80d556dfd7935b6464ec76b49c9c0e6249e0 (patch) | |
tree | 4bc938b2043e89f5a88cb81f81196a9da3b75f0f /dovetail/utils | |
parent | de58a1bd6d908aefc8461c866901e64c12454c8b (diff) |
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 <xudan16@huawei.com>
Diffstat (limited to 'dovetail/utils')
-rw-r--r-- | dovetail/utils/dovetail_utils.py | 17 |
1 files changed, 17 insertions, 0 deletions
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 |