aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/input_data_parser.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2019-03-07 13:32:21 +0100
committerTibor Frank <tifrank@cisco.com>2019-03-08 12:53:57 +0100
commitf0bd1290cd8b98d11c2a4188598cfdf009252ca9 (patch)
tree2014668317fba9aa966cd1dbc4b3ff1751b58350 /resources/tools/presentation/input_data_parser.py
parent1999c2ecc15760a57bdf34498635432ddb0321e0 (diff)
CSIT-1452: Make PAL use PapiHistory instead of VatHistory
- First step: Add PapiHistory Change-Id: I499d64f951f17f04557a7ba793dcc1593f37a1bd Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/input_data_parser.py')
-rw-r--r--resources/tools/presentation/input_data_parser.py49
1 files changed, 38 insertions, 11 deletions
diff --git a/resources/tools/presentation/input_data_parser.py b/resources/tools/presentation/input_data_parser.py
index 7b36352ed9..37194217a1 100644
--- a/resources/tools/presentation/input_data_parser.py
+++ b/resources/tools/presentation/input_data_parser.py
@@ -79,7 +79,7 @@ class ExecutionChecker(ResultVisitor):
"parent": "Name of the parent of the test",
"doc": "Test documentation",
"msg": "Test message",
- "vat-history": "DUT1 and DUT2 VAT History",
+ "conf-history": "DUT1 and DUT2 VAT History",
"show-run": "Show Run",
"tags": ["tag 1", "tag 2", "tag n"],
"type": "NDRPDR",
@@ -199,7 +199,7 @@ class ExecutionChecker(ResultVisitor):
}
},
"lossTolerance": "lossTolerance", # Only type: "PDR"
- "vat-history": "DUT1 and DUT2 VAT History"
+ "conf-history": "DUT1 and DUT2 VAT History"
"show-run": "Show Run"
},
"ID" {
@@ -236,7 +236,7 @@ class ExecutionChecker(ResultVisitor):
"doc": "Test documentation"
"msg": "Test message"
"tags": ["tag 1", "tag 2", "tag n"],
- "vat-history": "DUT1 and DUT2 VAT History"
+ "conf-history": "DUT1 and DUT2 VAT History"
"show-run": "Show Run"
"status": "PASS" | "FAIL"
},
@@ -337,7 +337,7 @@ class ExecutionChecker(ResultVisitor):
# 1 - VAT History of DUT1
# 2 - VAT History of DUT2
self._lookup_kw_nr = 0
- self._vat_history_lookup_nr = 0
+ self._conf_history_lookup_nr = 0
# Number of Show Running messages found
# 0 - no message
@@ -366,6 +366,7 @@ class ExecutionChecker(ResultVisitor):
"vpp-version": self._get_vpp_version,
"dpdk-version": self._get_dpdk_version,
"teardown-vat-history": self._get_vat_history,
+ "teardown-papi-history": self._get_papi_history,
"test-show-runtime": self._get_show_run,
"testbed": self._get_testbed
}
@@ -454,9 +455,9 @@ class ExecutionChecker(ResultVisitor):
:returns: Nothing.
"""
if msg.message.count("VAT command history:"):
- self._vat_history_lookup_nr += 1
- if self._vat_history_lookup_nr == 1:
- self._data["tests"][self._test_ID]["vat-history"] = str()
+ self._conf_history_lookup_nr += 1
+ if self._conf_history_lookup_nr == 1:
+ self._data["tests"][self._test_ID]["conf-history"] = str()
else:
self._msg_type = None
text = re.sub("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3} "
@@ -464,9 +465,31 @@ class ExecutionChecker(ResultVisitor):
replace("\n\n", "\n").replace('\n', ' |br| ').\
replace('\r', '').replace('"', "'")
- self._data["tests"][self._test_ID]["vat-history"] += " |br| "
- self._data["tests"][self._test_ID]["vat-history"] += \
- "**DUT" + str(self._vat_history_lookup_nr) + ":** " + text
+ self._data["tests"][self._test_ID]["conf-history"] += " |br| "
+ self._data["tests"][self._test_ID]["conf-history"] += \
+ "**DUT" + str(self._conf_history_lookup_nr) + ":** " + text
+
+ def _get_papi_history(self, msg):
+ """Called when extraction of PAPI command history is required.
+
+ :param msg: Message to process.
+ :type msg: Message
+ :returns: Nothing.
+ """
+ if msg.message.count("PAPI command history:"):
+ self._conf_history_lookup_nr += 1
+ if self._conf_history_lookup_nr == 1:
+ self._data["tests"][self._test_ID]["conf-history"] = str()
+ else:
+ self._msg_type = None
+ text = re.sub("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3} "
+ "PAPI command history:", "", msg.message, count=1). \
+ replace("\n\n", "\n").replace('\n', ' |br| ').\
+ replace('\r', '').replace('"', "'")
+
+ self._data["tests"][self._test_ID]["conf-history"] += " |br| "
+ self._data["tests"][self._test_ID]["conf-history"] += \
+ "**DUT" + str(self._conf_history_lookup_nr) + ":** " + text
def _get_show_run(self, msg):
"""Called when extraction of VPP operational data (output of CLI command
@@ -1005,9 +1028,13 @@ class ExecutionChecker(ResultVisitor):
"""
if teardown_kw.name.count("Show Vat History On All Duts"):
- self._vat_history_lookup_nr = 0
+ self._conf_history_lookup_nr = 0
self._msg_type = "teardown-vat-history"
teardown_kw.messages.visit(self)
+ elif teardown_kw.name.count("Show Papi History On All Duts"):
+ self._conf_history_lookup_nr = 0
+ self._msg_type = "teardown-papi-history"
+ teardown_kw.messages.visit(self)
def end_teardown_kw(self, teardown_kw):
"""Called when keyword ends. Default implementation does nothing.