Bugfix about the ipv6 results checker 51/33651/2
authorxudan <xudan16@huawei.com>
Sat, 22 Apr 2017 04:00:51 +0000 (04:00 +0000)
committerxudan <xudan16@huawei.com>
Sat, 22 Apr 2017 06:55:48 +0000 (06:55 +0000)
JIRA: DOVETAIL-404

1. IPV6 sub-testcase's name includes [id], which will affects the regex.
2. Remove the [id] from the name of the sub_testcases.

Change-Id: I51b567e8382fa4e701f8b32ba7ea195d49fd31eb
Signed-off-by: xudan <xudan16@huawei.com>
dovetail/report.py

index c7eff3d..c51ce68 100644 (file)
@@ -386,9 +386,15 @@ class FunctestChecker(object):
     def get_sub_testcase(sub_testcase, result):
         if not result:
             return False
+        sub_testcase = re.sub("\[.*?\]", "", sub_testcase)
         reg = sub_testcase + '[\s+\d+]'
         find_reg = re.compile(reg)
         match = find_reg.findall(result)
+        if match:
+            return True
+        reg = sub_testcase + '$'
+        find_reg = re.compile(reg)
+        match = find_reg.findall(result)
         if match:
             return True
         return False