[dts] [PATCH V1 1/7] framework/dut: record DPDK version in host DUT

Haiyang Zhao haiyangx.zhao at intel.com
Fri Nov 27 03:50:23 CET 2020


get dpdk version from VERSION and save it in host dut.

Signed-off-by: Haiyang Zhao <haiyangx.zhao at intel.com>
---
 framework/dut.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/framework/dut.py b/framework/dut.py
index 2863848..f3ef8c6 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -80,6 +80,7 @@ class Dut(Crb):
         self.hugepage_path = None
         self.apps_name_conf = {}
         self.apps_name = {}
+        self.dpdk_version = ''
 
     def filter_cores_from_crb_cfg(self):
         # get core list from crbs.cfg
@@ -368,7 +369,13 @@ class Dut(Crb):
         Then call pci scan function to collect nic device information.
         At last setup DUT' environment for validation.
         """
-        self.send_expect("cd %s" % self.base_dir, "# ")
+        out = self.send_expect("cd %s" % self.base_dir, "# ")
+        assert 'No such file or directory' not in out, "Can't switch to dpdk folder!!!"
+        out = self.send_expect("cat VERSION", "# ")
+        if 'No such file or directory' in out:
+            self.logger.error("Can't get DPDK version due to VERSION not exist!!!")
+        else:
+            self.dpdk_version = out
         self.send_expect("alias ls='ls --color=none'", "#")
 
         if self.get_os_type() == 'freebsd':
-- 
2.17.1



More information about the dts mailing list