From 5a15f57c07a5683da58f5b78e28c1a1f1bd368a4 Mon Sep 17 00:00:00 2001 From: xudan Date: Tue, 23 May 2017 02:22:05 -0400 Subject: change the name of Yardstick results file and some log msg JIRA: DOVETAIL-428 1. Change the name of Yardstick result file from opnfv_yardstick_tc019.out to dovetail.ha.tc001.out. Because opnfv_yardstick_tc019 is the name defined in Yardstick and dovetail.ha.tc001 is the name defined in Dovetail. 2. Check whether the file exists before reporting the results are stored in file. 3. Delete test cases vping_ssh, vping_userdata and sdnvpn.tc003 from the testsuite proposed_tests. Change-Id: I4cb16947729479616a03abd9e91b76f9a41a949c Signed-off-by: xudan --- dovetail/compliance/proposed_tests.yml | 4 ---- dovetail/conf/yardstick_config.yml | 2 +- dovetail/report.py | 4 ++-- dovetail/run.py | 20 ++++++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'dovetail') diff --git a/dovetail/compliance/proposed_tests.yml b/dovetail/compliance/proposed_tests.yml index de892e5d..9d63cb2a 100644 --- a/dovetail/compliance/proposed_tests.yml +++ b/dovetail/compliance/proposed_tests.yml @@ -31,9 +31,6 @@ proposed_tests: - dovetail.ipv6.tc023 - dovetail.ipv6.tc024 - dovetail.ipv6.tc025 - # nfvi, vping_ssh, vping_userdata - - dovetail.nfvi.tc001 - - dovetail.nfvi.tc002 # HA - dovetail.ha.tc001 - dovetail.ha.tc002 @@ -46,6 +43,5 @@ proposed_tests: # sdnvpn - dovetail.sdnvpn.tc001 - dovetail.sdnvpn.tc002 - - dovetail.sdnvpn.tc003 - dovetail.sdnvpn.tc004 - dovetail.sdnvpn.tc008 diff --git a/dovetail/conf/yardstick_config.yml b/dovetail/conf/yardstick_config.yml index bc207d7f..9f56cb11 100644 --- a/dovetail/conf/yardstick_config.yml +++ b/dovetail/conf/yardstick_config.yml @@ -15,7 +15,7 @@ yardstick: - 'mkdir -p /home/opnfv/yardstick/results/' - "cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh && yardstick -d task start tests/opnfv/test_cases/{{validate_testcase}}.yaml - --output-file /home/opnfv/yardstick/results/{{validate_testcase}}.out + --output-file /home/opnfv/yardstick/results/{{testcase}}.out --task-args '{'file': '/home/opnfv/userconfig/pre_config/pod.yaml'}'" post_condition: - '' diff --git a/dovetail/report.py b/dovetail/report.py index 0d83831d..b864de98 100644 --- a/dovetail/report.py +++ b/dovetail/report.py @@ -264,7 +264,7 @@ class FunctestCrawler(object): "errors": error_case, "skipped": skipped_case} except KeyError as e: - self.logger.error("Key error, exception: %s", e) + self.logger.error("Result data don't have key %s.", e) return None except ValueError: continue @@ -313,7 +313,7 @@ class YardstickCrawler(object): def crawl_from_file(self, testcase=None): file_path = os.path.join(dt_cfg.dovetail_config['result_dir'], - testcase.validate_testcase() + '.out') + testcase.name() + '.out') if not os.path.exists(file_path): self.logger.info('result file not found: %s', file_path) return None diff --git a/dovetail/run.py b/dovetail/run.py index 521379d7..00376360 100755 --- a/dovetail/run.py +++ b/dovetail/run.py @@ -92,14 +92,18 @@ def check_tc_result(testcase, logger): logger.error("Fail to push results to database.") if dt_cfg.dovetail_config['report_dest'] == "file": if validate_type.lower() == 'yardstick': - logger.info("Results have been stored with file %s.", - os.path.join(result_dir, - testcase.validate_testcase() + '.out')) - if validate_type.lower() == 'functest': - logger.info("Results have been stored with file %s.", - os.path.join(result_dir, functest_result)) - result = Report.get_result(testcase) - Report.check_result(testcase, result) + result_file = os.path.join(result_dir, testcase.name() + '.out') + elif validate_type.lower() == 'functest': + result_file = os.path.join(result_dir, functest_result) + else: + logger.error("Don't support %s now.", validate_type) + return + if os.path.isfile(result_file): + logger.info("Results have been stored with file %s.", result_file) + result = Report.get_result(testcase) + Report.check_result(testcase, result) + else: + logger.error("Fail to store results with file %s.", result_file) def validate_input(input_dict, check_dict, logger): -- cgit 1.2.3-korg