test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1]tests/ethtool_stats: add file-prefix to run dpdk-procinfo
@ 2020-01-07  8:46 Xiao Qimai
       [not found] ` <279cabb24c28444584b4b365dba5f176@intel.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Xiao Qimai @ 2020-01-07  8:46 UTC (permalink / raw)
  To: dts; +Cc: Xiao Qimai

testpmd launched with file-prefix, so need add this parameter when starting dpdk-procinfo

Signed-off-by: Xiao Qimai <qimaix.xiao@intel.com>
---
 tests/TestSuite_ethtool_stats.py | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_ethtool_stats.py b/tests/TestSuite_ethtool_stats.py
index e8ea941..e5d8164 100644
--- a/tests/TestSuite_ethtool_stats.py
+++ b/tests/TestSuite_ethtool_stats.py
@@ -97,8 +97,17 @@ class TestEthtoolStats(TestCase):
         self.testpmd = PmdOutput(self.dut)
         self.is_pmd_on = False
 
+    def get_prefix(self, out):
+        p = re.compile("socket\s+/var/run/dpdk/(.+?)/")
+        m = p.search(out)
+        if m:
+            self.prefix_option = "--file-prefix=%s" % m.group(1)
+        else:
+            self.prefix_option = None
+
     def start_testpmd(self):
-        self.testpmd.start_testpmd('1S/2C/1T', param='--port-topology=loop')
+        out = self.testpmd.start_testpmd('1S/2C/1T', param='--port-topology=loop')
+        self.get_prefix(out)
         self.is_pmd_on = True
         time.sleep(2)
 
@@ -157,8 +166,12 @@ class TestEthtoolStats(TestCase):
         ports_count = len(self.dut_ports)
         ports_mask = reduce(lambda x, y: x | y,
                             map(lambda x: 0x1 << x, range(ports_count)))
-        self.query_tool = os.path.join(
-            self.target_dir, self.target, 'app', 'dpdk-procinfo')
+        if self.prefix_option:
+            self.query_tool = os.path.join(
+                self.target_dir, self.target, 'app', 'dpdk-procinfo %s' % self.prefix_option)
+        else:
+            self.query_tool = os.path.join(
+                self.target_dir, self.target, 'app', 'dpdk-procinfo')
         self.dpdk_proc_info = "%s -v -- -p %s" % (self.query_tool, ports_mask)
 
     def parse_proc_info_xstat_output(self, msg):
@@ -384,6 +397,7 @@ class TestEthtoolStats(TestCase):
         except_content = None
         try:
             self.start_testpmd()
+            self.init_proc_info()
             self.set_testpmd()
             self.check_xstat_command_list()
         except Exception as e:
@@ -401,6 +415,7 @@ class TestEthtoolStats(TestCase):
         except_content = None
         try:
             self.start_testpmd()
+            self.init_proc_info()
             self.set_testpmd()
             self.traffic()
             self.clear_pmd_ports_stat()
@@ -420,6 +435,7 @@ class TestEthtoolStats(TestCase):
         except_content = None
         try:
             self.start_testpmd()
+            self.init_proc_info()
             self.set_testpmd()
             self.check_xstat_statistic_integrity()
         except Exception as e:
@@ -462,7 +478,6 @@ class TestEthtoolStats(TestCase):
         self.frame_sizes = [64, 72, 128, 256, 512, 1024]
         # init binary
         self.init_testpmd()
-        self.init_proc_info()
     #
     # Test cases.
     #
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-15  8:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07  8:46 [dts] [PATCH V1]tests/ethtool_stats: add file-prefix to run dpdk-procinfo Xiao Qimai
     [not found] ` <279cabb24c28444584b4b365dba5f176@intel.com>
2020-01-15  8:52   ` Zhang, XiX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).