+ def _get_data_from_perf_test_msg(self, msg):
+ """Get
+ - NDR_LOWER
+ - LATENCY
+ - NDR_UPPER
+ - PDR_LOWER
+ - LATENCY
+ - PDR_UPPER
+ from message of NDRPDR performance tests.
+
+ :param msg: Message to be processed.
+ :type msg: str
+ :returns: Processed message or original message if a problem occurs.
+ :rtype: str
+ """
+
+ groups = re.search(self.REGEX_PERF_MSG_INFO, msg)
+ if not groups or groups.lastindex != 20:
+ return msg
+
+ try:
+ data = {
+ u"ndr_low": float(groups.group(1)),
+ u"ndr_low_unit": groups.group(2),
+ u"ndr_low_b": float(groups.group(3)),
+ u"ndr_low_b_unit": groups.group(4),
+ u"ndr_lat_1": groups.group(5),
+ u"ndr_lat_2": groups.group(6),
+ u"ndr_up": float(groups.group(7)),
+ u"ndr_up_unit": groups.group(8),
+ u"ndr_up_b": float(groups.group(9)),
+ u"ndr_up_b_unit": groups.group(10),
+ u"pdr_low": float(groups.group(11)),
+ u"pdr_low_unit": groups.group(12),
+ u"pdr_low_b": float(groups.group(13)),
+ u"pdr_low_b_unit": groups.group(14),
+ u"pdr_lat_1": groups.group(15),
+ u"pdr_lat_2": groups.group(16),
+ u"pdr_up": float(groups.group(17)),
+ u"pdr_up_unit": groups.group(18),
+ u"pdr_up_b": float(groups.group(19)),
+ u"pdr_up_b_unit": groups.group(20)
+ }
+ except (AttributeError, IndexError, ValueError, KeyError):
+ return msg
+
+ def _process_lat(in_str):
+ """Extract min, avg, max values from latency string.
+
+ :param in_str: Latency string produced by robot framework.
+ :type in_str: str
+ :returns: Processed latency string or original string if a problem
+ occurs.
+ :rtype: str
+ """
+ in_list = in_str.split('/', 3)
+ if len(in_list) < 3:
+ return in_str
+
+ return f"min={in_list[0]}, avg={in_list[1]}, max={in_list[2]}"
+
+ try:
+ return (
+ f"NDR Lower: {(data[u'ndr_low'] / 1e6):.2f}"
+ f"M{data[u'ndr_low_unit']}, "
+ f"{data[u'ndr_low_b']:.2f}{data[u'ndr_low_b_unit']}\n"
+ # f"NDR Upper: {(data[u'ndr_up'] / 1e6):.2f}"
+ # f"M{data[u'ndr_up_unit']}, "
+ # f"{data[u'ndr_up_b']:.2f}{data[u'ndr_up_b_unit']}\n"
+ f"NDR Latency W-E: {_process_lat(data[u'ndr_lat_1'])}\n"
+ f"NDR Latency E-W: {_process_lat(data[u'ndr_lat_2'])}\n"
+ f"PDR Lower: {(data[u'pdr_low'] / 1e6):.2f}"
+ f"M{data[u'pdr_low_unit']}, "
+ f"{data[u'pdr_low_b']:.2f}{data[u'pdr_low_b_unit']}\n"
+ # f"PDR Upper: {(data[u'pdr_up'] / 1e6):.2f}"
+ # f"M{data[u'pdr_up_unit']}, "
+ # f"{data[u'pdr_up_b']:.2f}{data[u'pdr_up_b_unit']}\n"
+ f"PDR Latency W-E: {_process_lat(data[u'pdr_lat_1'])}\n"
+ f"PDR Latency E-W: {_process_lat(data[u'pdr_lat_2'])}"
+ )
+ except (AttributeError, IndexError, ValueError, KeyError):
+ return msg
+
+ def _get_testbed(self, msg):
+ """Called when extraction of testbed IP is required.
+ The testbed is identified by TG node IP address.
+
+ :param msg: Message to process.
+ :type msg: Message
+ :returns: Nothing.
+ """
+
+ if msg.message.count(u"Setup of TG node") or \
+ msg.message.count(u"Setup of node TG host"):
+ reg_tg_ip = re.compile(
+ r'.*TG .* (\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}).*')
+ try:
+ self._testbed = str(re.search(reg_tg_ip, msg.message).group(1))
+ except (KeyError, ValueError, IndexError, AttributeError):
+ pass
+ finally:
+ self._data[u"metadata"][u"testbed"] = self._testbed
+ self._msg_type = None
+
+ def _get_vpp_version(self, msg):