- test_result["name"] = test.name.lower()
- test_result["parent"] = test.parent.name.lower()
- test_result["tags"] = tags
- doc_str = test.doc.replace('"', "'").replace('\n', ' '). \
- replace('\r', '').replace('[', ' |br| [')
- test_result["doc"] = replace(doc_str, ' |br| [', '[', maxreplace=1)
- test_result["msg"] = test.message.replace('\n', ' |br| '). \
- replace('\r', '').replace('"', "'")
- test_result["status"] = test.status
- if test.status == "PASS" and ("NDRPDRDISC" in tags or
- "TCP" in tags or
- "MRR" in tags):
- if "NDRDISC" in tags:
- test_type = "NDR"
- elif "PDRDISC" in tags:
- test_type = "PDR"
- elif "TCP" in tags:
- test_type = "TCP"
- elif "MRR" in tags:
- test_type = "MRR"
+
+ # Change the TC long name and name if defined in the mapping table
+ longname = self._mapping.get(longname_orig, None)
+ if longname is not None:
+ name = longname.split(u'.')[-1]
+ logging.debug(
+ f"{self._data[u'metadata']}\n{longname_orig}\n{longname}\n"
+ f"{name}"
+ )
+ else:
+ longname = longname_orig
+ name = test.name.lower()
+
+ # Remove TC number from the TC long name (backward compatibility):
+ self._test_id = re.sub(self.REGEX_TC_NUMBER, u"", longname)
+ # Remove TC number from the TC name (not needed):
+ test_result[u"name"] = re.sub(self.REGEX_TC_NUMBER, "", name)
+
+ test_result[u"parent"] = test.parent.name.lower()
+ test_result[u"tags"] = tags
+ test_result["doc"] = test.doc.\
+ replace(u'"', u"'").\
+ replace(u'\n', u' ').\
+ replace(u'\r', u'').\
+ replace(u'[', u' |br| [').\
+ replace(u' |br| [', u'[', 1)
+ test_result[u"msg"] = test.message.\
+ replace(u'\n', u' |br| ').\
+ replace(u'\r', u'').\
+ replace(u'"', u"'")
+ test_result[u"type"] = u"FUNC"
+ test_result[u"status"] = test.status
+
+ if u"PERFTEST" in tags:
+ # 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
+ tag_tc = str()
+ for tag in test_result[u"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,
+ f"-{tag_tc.lower()}-",
+ self._test_id,
+ count=1)
+ test_result[u"name"] = re.sub(self.REGEX_TC_NAME_NEW,
+ f"-{tag_tc.lower()}-",
+ test_result["name"],
+ count=1)
+ else:
+ test_result[u"status"] = u"FAIL"
+ self._data[u"tests"][self._test_id] = test_result
+ logging.debug(
+ f"The test {self._test_id} has no or more than one "
+ f"multi-threading tags.\n"
+ f"Tags: {test_result[u'tags']}"
+ )
+ return
+
+ if test.status == u"PASS":
+ if u"NDRPDR" in tags:
+ test_result[u"type"] = u"NDRPDR"
+ test_result[u"throughput"], test_result[u"status"] = \
+ self._get_ndrpdr_throughput(test.message)
+ test_result[u"latency"], test_result[u"status"] = \
+ self._get_ndrpdr_latency(test.message)
+ elif u"SOAK" in tags:
+ test_result[u"type"] = u"SOAK"
+ test_result[u"throughput"], test_result[u"status"] = \
+ self._get_plr_throughput(test.message)
+ elif u"TCP" in tags:
+ test_result[u"type"] = u"TCP"
+ groups = re.search(self.REGEX_TCP, test.message)
+ test_result[u"result"] = int(groups.group(2))
+ elif u"MRR" in tags or u"FRMOBL" in tags or u"BMRR" in tags:
+ if u"MRR" in tags:
+ test_result[u"type"] = u"MRR"
+ else:
+ test_result[u"type"] = u"BMRR"
+
+ test_result[u"result"] = dict()
+ groups = re.search(self.REGEX_BMRR, test.message)
+ if groups is not None:
+ items_str = groups.group(1)
+ items_float = [float(item.strip()) for item
+ in items_str.split(",")]
+ # Use whole list in CSIT-1180.
+ stats = jumpavg.AvgStdevStats.for_runs(items_float)
+ test_result[u"result"][u"receive-rate"] = stats.avg
+ else:
+ groups = re.search(self.REGEX_MRR, test.message)
+ test_result[u"result"][u"receive-rate"] = \
+ float(groups.group(3)) / float(groups.group(1))
+ elif u"RECONF" in tags:
+ test_result[u"type"] = u"RECONF"
+ test_result[u"result"] = None
+ try:
+ grps_loss = re.search(self.REGEX_RECONF_LOSS, test.message)
+ grps_time = re.search(self.REGEX_RECONF_TIME, test.message)
+ test_result[u"result"] = {
+ u"loss": int(grps_loss.group(1)),
+ u"time": float(grps_time.group(1))
+ }
+ except (AttributeError, IndexError, ValueError, TypeError):
+ test_result[u"status"] = u"FAIL"