CSIT-1452: Make PAL use PapiHistory instead of VatHistory 13/18113/8
authorTibor Frank <tifrank@cisco.com>
Thu, 7 Mar 2019 12:32:21 +0000 (13:32 +0100)
committerTibor Frank <tifrank@cisco.com>
Fri, 8 Mar 2019 11:53:57 +0000 (12:53 +0100)
- First step: Add PapiHistory

Change-Id: I499d64f951f17f04557a7ba793dcc1593f37a1bd
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/generator_tables.py
resources/tools/presentation/input_data_parser.py
resources/tools/presentation/specification.yaml

index 7fc1d0c..b55e4a5 100644 (file)
@@ -96,7 +96,7 @@ def table_details(table, input_data):
                     try:
                         col_data = str(data[job][build][test][column["data"].
                                        split(" ")[1]]).replace('"', '""')
-                        if column["data"].split(" ")[1] in ("vat-history",
+                        if column["data"].split(" ")[1] in ("conf-history",
                                                             "show-run"):
                             col_data = replace(col_data, " |br| ", "",
                                                maxreplace=1)
@@ -161,7 +161,7 @@ def table_merged_details(table, input_data):
                     try:
                         col_data = str(data[test][column["data"].
                                        split(" ")[1]]).replace('"', '""')
-                        if column["data"].split(" ")[1] in ("vat-history",
+                        if column["data"].split(" ")[1] in ("conf-history",
                                                             "show-run"):
                             col_data = replace(col_data, " |br| ", "",
                                                maxreplace=1)
index 7b36352..3719421 100644 (file)
@@ -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.
index 1853f79..eb5dc2e 100644 (file)
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "vpp-perf-results-3n-hsw"
   filter: "not 'NDRCHK' and not 'PDRCHK'"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 # Test configuration - VPP Performance Test Configs 3n-skx
 -
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "vpp-perf-results-3n-skx"
   filter: "not 'NDRCHK' and not 'PDRCHK'"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 # Test configuration - VPP Performance Test Configs 2n-skx
 -
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "vpp-perf-results-2n-skx"
   filter: "not 'NDRCHK' and not 'PDRCHK'"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 # Test configuration - VPP Performance Test Configs 2n-dnv
 -
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "intel-dnv-vpp"
   filter: "'NDRPDR'"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 # Test Operational Data - VPP Performance Operational Data 3n-hsw
 -
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "vpp-mrr-results-3n-hsw"
   filter: "'MRR'"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 # Test configuration - VPP MRR Test Configs 3n-skx
 -
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "vpp-mrr-results-3n-skx"
   filter: "'MRR'"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 # Test configuration - VPP MRR Test Configs 2n-skx
 -
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "vpp-mrr-results-2n-skx"
   filter: "'MRR'"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 # Test configuration - VPP MRR Test Configs 2n-dnv
 -
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "intel-dnv-vpp"
   filter: "'MRR'"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 # Detailed Test Results - VPP Functional Results - Ubuntu
 -
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "vpp-func-results-ubuntu"
   filter: "all"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 # Test configuration - VPP Functional Test Configs - CentOS
 -
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "vpp-func-results-centos"
   filter: "all"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 # Detailed Test Results - Container Orchestrated Topologies Performance Results 3n-hsw
 -
     title: "Name"
     data: "data name"
   -
-    title: "VPP API Test (VAT) Commands History - Commands Used Per Test Case"
-    data: "data vat-history"
+    title: "VPP API Test Commands History - Commands Used Per Test Case"
+    data: "data conf-history"
   rows: "generated"
   data: "vpp-device-results-ubuntu"
   filter: "all"
   parameters:
   - "parent"
   - "name"
-  - "vat-history"
+  - "conf-history"
 
 ################################################################################