From 7eefbe8f7ec52d727e8e504e4ddd4ddb57cf569e Mon Sep 17 00:00:00 2001 From: boucherv Date: Wed, 10 Aug 2016 18:59:41 +0200 Subject: Create config_functest patch to update the conf with scenario Adding support of LXD scenario JIRA: FUNCTEST-268 Change-Id: I5891ff9de674d99d32d8db747be501ee8a2e6609 Signed-off-by: boucherv --- utils/functest_utils.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'utils/functest_utils.py') diff --git a/utils/functest_utils.py b/utils/functest_utils.py index cb2333d42..d020ebac8 100644 --- a/utils/functest_utils.py +++ b/utils/functest_utils.py @@ -212,10 +212,10 @@ def push_results_to_db(project, case_name, logger, logger.debug(r) return True except Exception, e: - print ("Error [push_results_to_db('%s', '%s', '%s', " + - "'%s', '%s', '%s', '%s', '%s', '%s')]:" % - (url, project, case_name, pod_name, version, - scenario, criteria, build_tag, details)), e + print("Error [push_results_to_db('%s', '%s', '%s', " + + "'%s', '%s', '%s', '%s', '%s', '%s')]:" % + (url, project, case_name, pod_name, version, + scenario, criteria, build_tag, details)), e return False @@ -372,6 +372,19 @@ def check_success_rate(case_name, success_rate): return status +def merge_dicts(dict1, dict2): + for k in set(dict1.keys()).union(dict2.keys()): + if k in dict1 and k in dict2: + if isinstance(dict1[k], dict) and isinstance(dict2[k], dict): + yield (k, dict(merge_dicts(dict1[k], dict2[k]))) + else: + yield (k, dict2[k]) + elif k in dict1: + yield (k, dict1[k]) + else: + yield (k, dict2[k]) + + def check_test_result(test_name, ret, start_time, stop_time): def get_criteria_value(): return get_criteria_by_test(test_name).split('==')[1].strip() -- cgit 1.2.3-korg