CSIT-1326 Add barrier event traces 42/15042/11
authorPeter Mikus <pmikus@cisco.com>
Fri, 28 Sep 2018 13:55:42 +0000 (13:55 +0000)
committerPeter Mikus <pmikus@cisco.com>
Mon, 1 Oct 2018 11:52:35 +0000 (11:52 +0000)
Change-Id: I0f734c2f11cc89716371554880f1d7404ea16090
Signed-off-by: Peter Mikus <pmikus@cisco.com>
resources/libraries/python/VPPUtil.py
resources/libraries/robot/performance/performance_setup.robot
resources/libraries/robot/performance/performance_utils.robot
resources/templates/vat/show_event_logger.vat [new file with mode: 0644]
resources/templates/vat/test_threads_barrier_elog.vat [new file with mode: 0644]

index 17310aa..f6b3afa 100644 (file)
@@ -211,3 +211,46 @@ class VPPUtil(object):
         for node in nodes.values():
             if node['type'] == NodeType.DUT:
                 VPPUtil.vpp_enable_traces_on_dut(node)
+
+    @staticmethod
+    def vpp_enable_barrier_traces_on_dut(node):
+        """Enable vpp barrier traces on the DUT node.
+
+        :param node: DUT node to set up.
+        :type node: dict
+        """
+        vat = VatExecutor()
+        vat.execute_script("test_threads_barrier_elog.vat", node,
+                           json_out=False)
+
+    @staticmethod
+    def vpp_enable_barrier_traces_on_all_duts(nodes):
+        """Enable vpp barrier traces on all DUTs in the given topology.
+
+        :param nodes: Nodes in the topology.
+        :type nodes: dict
+        """
+        for node in nodes.values():
+            if node['type'] == NodeType.DUT:
+                VPPUtil.vpp_enable_barrier_traces_on_dut(node)
+
+    @staticmethod
+    def show_event_logger_on_dut(node):
+        """Show event logger on the DUT node.
+
+        :param node: DUT node to show traces on.
+        :type node: dict
+        """
+        vat = VatExecutor()
+        vat.execute_script("show_event_logger.vat", node, json_out=False)
+
+    @staticmethod
+    def show_event_logger_on_all_duts(nodes):
+        """Show event logger on all DUTs in the given topology.
+
+        :param nodes: Nodes in the topology.
+        :type nodes: dict
+        """
+        for node in nodes.values():
+            if node['type'] == NodeType.DUT:
+                VPPUtil.show_event_logger_on_dut(node)
\ No newline at end of file
index f5288e7..f92f88b 100644 (file)
 
 # Keywords used in setups and teardowns
 
-| Set variables in 2-node circular topology
-| | [Documentation]
-| | ... | Compute path for testing on two given nodes in circular
-| | ... | topology and set corresponding suite variables.
-| | ...
-| | ... | _NOTE:_ This KW sets following suite variables:
-| | ... | - tg - TG node
-| | ... | - tg_if1 - 1st TG interface towards DUT.
-| | ... | - tg_if2 - 2nd TG interface towards DUT.
-| | ... | - dut1 - DUT1 node
-| | ... | - dut1_if1 - 1st DUT interface towards TG.
-| | ... | - dut1_if2 - 2nd DUT interface towards TG.
-| | ...
-| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
-| | Compute Path | always_same_link=${FALSE}
-| | ${tg_if1} | ${tg}= | First Interface
-| | ${dut1_if1} | ${dut1}= | First Ingress Interface
-| | ${dut1_if2} | ${dut1}= | Last Egress Interface
-| | ${tg_if2} | ${tg}= | Last Interface
-| | Set Suite Variable | ${tg}
-| | Set Suite Variable | ${tg_if1}
-| | Set Suite Variable | ${tg_if2}
-| | Set Suite Variable | ${dut1}
-| | Set Suite Variable | ${dut1_if1}
-| | Set Suite Variable | ${dut1_if2}
-
-| Set variables in 3-node circular topology
-| | [Documentation]
-| | ... | Compute path for testing on three given nodes in circular
-| | ... | topology and set corresponding suite variables.
-| | ...
-| | ... | _NOTE:_ This KW sets following suite variables:
-| | ... | - tg - TG node
-| | ... | - tg_if1 - TG interface towards DUT1.
-| | ... | - tg_if2 - TG interface towards DUT2.
-| | ... | - dut1 - DUT1 node
-| | ... | - dut1_if1 - DUT1 interface towards TG.
-| | ... | - dut1_if2 - DUT1 interface towards DUT2.
-| | ... | - dut2 - DUT2 node
-| | ... | - dut2_if1 - DUT2 interface towards DUT1.
-| | ... | - dut2_if2 - DUT2 interface towards TG.
-| | ...
-| | Append Nodes | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']}
-| | ... | ${nodes['TG']}
-| | Compute Path
-| | ${tg_if1} | ${tg}= | Next Interface
-| | ${dut1_if1} | ${dut1}= | Next Interface
-| | ${dut1_if2} | ${dut1}= | Next Interface
-| | ${dut2_if1} | ${dut2}= | Next Interface
-| | ${dut2_if2} | ${dut2}= | Next Interface
-| | ${tg_if2} | ${tg}= | Next Interface
-| | Set Suite Variable | ${tg}
-| | Set Suite Variable | ${tg_if1}
-| | Set Suite Variable | ${tg_if2}
-| | Set Suite Variable | ${dut1}
-| | Set Suite Variable | ${dut1_if1}
-| | Set Suite Variable | ${dut1_if2}
-| | Set Suite Variable | ${dut2}
-| | Set Suite Variable | ${dut2_if1}
-| | Set Suite Variable | ${dut2_if2}
-
 | Set variables in 2-node circular topology with DUT interface model
 | | [Documentation]
 | | ... | Compute path for testing on two given nodes in circular topology
 | | ... | Traffic should pass with no loss | ${perf_trial_duration} | ${rate}
 | | ... | ${framesize} | ${topology_type} | fail_on_loss=${False}
 
-| Tear down performance ndrchk test
-| | [Documentation] | Common test teardown for ndrchk performance tests.
-| | ...
-| | Remove All Added Ports On All DUTs From Topology | ${nodes}
-| | Show VAT History On All DUTs | ${nodes}
-
-| Tear down performance pdrchk test
-| | [Documentation] | Common test teardown for pdrchk performance tests.
-| | ...
-| | Remove All Added Ports On All DUTs From Topology | ${nodes}
-| | Show VAT History On All DUTs | ${nodes}
-
 | Tear down performance mrr test
 | | [Documentation] | Common test teardown for max-received-rate performance
 | | ... | tests.
index 80aaa1d..e4ece56 100644 (file)
 | | Run Keyword If | ${dut_stats}==${True} | Clear all counters on all DUTs
 | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
 | | ... | VPP Enable Traces On All DUTs | ${nodes}
+| | Run Keyword If | ${dut_stats}==${True}
+| | ... | VPP enable barrier traces on all DUTs | ${nodes}
 | | ${results} = | Create List
 | | :FOR | ${i} | IN RANGE | ${subsamples}
 | | | Send traffic on tg | ${trial_duration} | ${rate} | ${framesize}
 | | | ${rx} = | Get Received
 | | | ${rr} = | Evaluate | ${rx} / ${trial_duration}
 | | | Append To List | ${results} | ${rr}
+| | Run Keyword If | ${dut_stats}==${True} | Show event logger on all DUTs
+| | ... | ${nodes}
 | | Run Keyword If | ${dut_stats}==${True} | Show statistics on all DUTs
 | | ... | ${nodes}
 | | Run Keyword If | ${dut_stats}==${True} and ${pkt_trace}==${True}
diff --git a/resources/templates/vat/show_event_logger.vat b/resources/templates/vat/show_event_logger.vat
new file mode 100644 (file)
index 0000000..cebbb1e
--- /dev/null
@@ -0,0 +1 @@
+exec show event-logger
diff --git a/resources/templates/vat/test_threads_barrier_elog.vat b/resources/templates/vat/test_threads_barrier_elog.vat
new file mode 100644 (file)
index 0000000..5be3c41
--- /dev/null
@@ -0,0 +1 @@
+exec test threads barrier-elog enable