+ # 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(
+ self.REGEX_RATE, test.message).group(1))
+ except AttributeError:
+ rate_value = "-1"
+ try:
+ rate_unit = str(re.search(
+ self.REGEX_RATE, test.message).group(2))
+ except AttributeError:
+ rate_unit = "-1"
+
+ test_result["throughput"] = dict()
+ test_result["throughput"]["value"] = \
+ int(rate_value.split('.')[0])
+ test_result["throughput"]["unit"] = rate_unit
+ test_result["latency"] = \
+ self._get_latency(test.message, test_type)
+ if test_type == "PDR":
+ test_result["lossTolerance"] = str(re.search(
+ self.REGEX_TOLERANCE, test.message).group(1))
+
+ elif test_type in ("TCP", ):
+ groups = re.search(self.REGEX_TCP, test.message)
+ test_result["result"] = dict()
+ test_result["result"]["value"] = int(groups.group(2))
+ test_result["result"]["unit"] = groups.group(1)
+
+ elif test_type in ("MRR", "BMRR"):
+ test_result["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(",")]
+ test_result["result"]["receive-rate"] = \
+ AvgStdevMetadataFactory.from_data(items_float)
+ else:
+ groups = re.search(self.REGEX_MRR, test.message)
+ test_result["result"]["receive-rate"] = \
+ AvgStdevMetadataFactory.from_data([
+ float(groups.group(3)) / float(groups.group(1)), ])
+