CSIT-1326 VLIB: barrier sync elog tracing
[csit.git] / resources / libraries / python / VPPUtil.py
index 17310aa..9d2a2b9 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_elog_traces_on_dut(node):
+        """Enable API/CLI/Barrier traces on the DUT node.
+
+        :param node: DUT node to set up.
+        :type node: dict
+        """
+        vat = VatExecutor()
+        vat.execute_script("elog_trace_api_cli_barrier.vat", node,
+                           json_out=False)
+
+    @staticmethod
+    def vpp_enable_elog_traces_on_all_duts(nodes):
+        """Enable API/CLI/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_elog_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)