change the name of Yardstick results file and some log msg 77/35177/4
authorxudan <xudan16@huawei.com>
Tue, 23 May 2017 06:22:05 +0000 (02:22 -0400)
committerxudan <xudan16@huawei.com>
Fri, 26 May 2017 03:36:55 +0000 (23:36 -0400)
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 <xudan16@huawei.com>
dovetail/compliance/proposed_tests.yml
dovetail/conf/yardstick_config.yml
dovetail/report.py
dovetail/run.py

index de892e5..9d63cb2 100644 (file)
@@ -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
index bc207d7..9f56cb1 100644 (file)
@@ -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:
     - ''
index 0d83831..b864de9 100644 (file)
@@ -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
index 521379d..0037636 100755 (executable)
@@ -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):