X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Finput_data_parser.py;h=ad3d32762ee717927186b0d73051ba86f4a6b028;hb=refs%2Fchanges%2F71%2F12771%2F59;hp=91c7747752a12900c6da3a2e212e1e8c611c801a;hpb=4b0df8e7baea755e2e1a1c27a7707fb0a3f28b6e;p=csit.git diff --git a/resources/tools/presentation/input_data_parser.py b/resources/tools/presentation/input_data_parser.py index 91c7747752..ad3d32762e 100644 --- a/resources/tools/presentation/input_data_parser.py +++ b/resources/tools/presentation/input_data_parser.py @@ -197,7 +197,14 @@ class ExecutionChecker(ResultVisitor): REGEX_MRR = re.compile(r'MaxReceivedRate_Results\s\[pkts/(\d*)sec\]:\s' r'tx\s(\d*),\srx\s(\d*)') - REGEX_BMRR = re.compile(r'Maximum Receive Rate Results \[(.*)\]') + REGEX_BMRR = re.compile(r'Maximum Receive Rate trial results' + r' in packets per second: \[(.*)\]') + + REGEX_TC_TAG = re.compile(r'\d+[tT]\d+[cC]') + + REGEX_TC_NAME_OLD = re.compile(r'-\d+[tT]\d+[cC]-') + + REGEX_TC_NAME_NEW = re.compile(r'-\d+[cC]-') def __init__(self, metadata): """Initialisation. @@ -478,6 +485,7 @@ class ExecutionChecker(ResultVisitor): test_result["msg"] = test.message.replace('\n', ' |br| '). \ replace('\r', '').replace('"', "'") test_result["status"] = test.status + self._test_ID = test.longname.lower() if test.status == "PASS" and ("NDRPDRDISC" in tags or "TCP" in tags or "MRR" in tags or @@ -497,6 +505,33 @@ class ExecutionChecker(ResultVisitor): test_result["type"] = test_type + # Replace info about cores (e.g. -1c-) with the info about threads + # and cores (e.g. -1t1c-) in the long test case names and in the + # test case names if necessary. + groups = re.search(self.REGEX_TC_NAME_OLD, self._test_ID) + if not groups: + tag_count = 0 + for tag in test_result["tags"]: + groups = re.search(self.REGEX_TC_TAG, tag) + if groups: + tag_count += 1 + tag_tc = tag + + if tag_count == 1: + self._test_ID = re.sub(self.REGEX_TC_NAME_NEW, + "-{0}-".format(tag_tc.lower()), + self._test_ID, + count=1) + test_result["name"] = re.sub(self.REGEX_TC_NAME_NEW, + "-{0}-".format(tag_tc.lower()), + test_result["name"], + count=1) + else: + test_result["status"] = "FAIL" + logging.error("The test '{0}' has no or more than one " + "multi-threading tags.".format(self._test_ID)) + return + if test_type in ("NDR", "PDR"): try: rate_value = str(re.search( @@ -540,7 +575,6 @@ class ExecutionChecker(ResultVisitor): AvgStdevMetadataFactory.from_data([ float(groups.group(3)) / float(groups.group(1)), ]) - self._test_ID = test.longname.lower() self._data["tests"][self._test_ID] = test_result def end_test(self, test):