Trending: Use Mpps
[csit.git] / resources / tools / presentation / input_data_parser.py
index dac5f19..2f126f4 100644 (file)
@@ -429,7 +429,6 @@ class ExecutionChecker(ResultVisitor):
                           r"PAPI command history:", u"",
                           msg.message, count=1).replace(u'\n', u' |br| ').\
                 replace(u'"', u"'")
-
             self._data[u"tests"][self._test_id][u"conf-history"] += (
                 f" |br| **DUT{str(self._conf_history_lookup_nr)}:** {text}"
             )
@@ -442,15 +441,24 @@ class ExecutionChecker(ResultVisitor):
         :type msg: Message
         :returns: Nothing.
         """
+
         if u"show-run" not in self._data[u"tests"][self._test_id].keys():
             self._data[u"tests"][self._test_id][u"show-run"] = str()
 
         if msg.message.count(u"stats runtime") or \
                 msg.message.count(u"Runtime"):
-            host = str(re.search(self.REGEX_TC_PAPI_CLI, msg.message).
-                       group(1))
-            socket = str(re.search(self.REGEX_TC_PAPI_CLI, msg.message).
-                         group(2))
+            try:
+                host = str(re.search(self.REGEX_TC_PAPI_CLI, msg.message).
+                           group(1))
+            except (AttributeError, IndexError):
+                host = self._data[u"tests"][self._test_id][u"show-run"].\
+                           count(u"DUT:") + 1
+            try:
+                socket = str(re.search(self.REGEX_TC_PAPI_CLI, msg.message).
+                             group(2))
+                socket = f"/{socket}"
+            except (AttributeError, IndexError):
+                socket = u""
             runtime = loads(
                 str(msg.message).
                 replace(u' ', u'').
@@ -519,7 +527,7 @@ class ExecutionChecker(ResultVisitor):
                 txt_table.align[u"Vectors/Calls"] = u"r"
 
                 text += txt_table.get_string(sortby=u"Name") + u'\n'
-            text = f" \n **DUT: {host}/{socket}** \n {text}".\
+            text = f"\n**DUT: {host}{socket}**\n{text}".\
                 replace(u'\n', u' |br| ').\
                 replace(u'\r', u'').\
                 replace(u'"', u"'")