UTI: Export results
[csit.git] / resources / libraries / python / VPPUtil.py
index e343d38..0d5dea5 100644 (file)
@@ -18,6 +18,9 @@ from robot.api import logger
 from resources.libraries.python.Constants import Constants
 from resources.libraries.python.DUTSetup import DUTSetup
 from resources.libraries.python.PapiExecutor import PapiSocketExecutor
 from resources.libraries.python.Constants import Constants
 from resources.libraries.python.DUTSetup import DUTSetup
 from resources.libraries.python.PapiExecutor import PapiSocketExecutor
+from resources.libraries.python.model.ExportResult import (
+    export_dut_type_and_version
+)
 from resources.libraries.python.ssh import exec_cmd_no_error, exec_cmd
 from resources.libraries.python.topology import Topology, SocketType, NodeType
 
 from resources.libraries.python.ssh import exec_cmd_no_error, exec_cmd
 from resources.libraries.python.topology import Topology, SocketType, NodeType
 
@@ -197,6 +200,7 @@ class VPPUtil:
         """Run "show_version" PAPI command.
 
         Socket is configurable, so VPP inside container can be accessed.
         """Run "show_version" PAPI command.
 
         Socket is configurable, so VPP inside container can be accessed.
+        The result is exported to JSON UTI output as "dut-version".
 
         :param node: Node to run command on.
         :param remote_vpp_socket: Path to remote socket to target VPP.
 
         :param node: Node to run command on.
         :param remote_vpp_socket: Path to remote socket to target VPP.
@@ -214,7 +218,9 @@ class VPPUtil:
             reply = papi_exec.add(cmd).get_reply()
         if log:
             logger.info(f"VPP version: {reply[u'version']}\n")
             reply = papi_exec.add(cmd).get_reply()
         if log:
             logger.info(f"VPP version: {reply[u'version']}\n")
-        return f"{reply[u'version']}"
+        version = f"{reply[u'version']}"
+        export_dut_type_and_version(u"VPP", version)
+        return version
 
     @staticmethod
     def show_vpp_version_on_all_duts(nodes):
 
     @staticmethod
     def show_vpp_version_on_all_duts(nodes):