test suite reviews and discussions
 help / color / mirror / Atom feed
From: Xiao Qimai <qimaix.xiao@intel.com>
To: dts@dpdk.org
Cc: Xiao Qimai <qimaix.xiao@intel.com>
Subject: [dts] [PATCH V1]tests/ethtool_stats: add file-prefix to run dpdk-procinfo
Date: Tue,  7 Jan 2020 16:46:53 +0800	[thread overview]
Message-ID: <1578386813-102975-1-git-send-email-qimaix.xiao@intel.com> (raw)

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


             reply	other threads:[~2020-01-07  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07  8:46 Xiao Qimai [this message]
     [not found] ` <279cabb24c28444584b4b365dba5f176@intel.com>
2020-01-15  8:52   ` Zhang, XiX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1578386813-102975-1-git-send-email-qimaix.xiao@intel.com \
    --to=qimaix.xiao@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).