test suite reviews and discussions
 help / color / 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

* Re: [dts] [PATCH V1]tests/ethtool_stats: add file-prefix to run dpdk-procinfo
       [not found] ` <279cabb24c28444584b4b365dba5f176@intel.com>
@ 2020-01-15  8:52   ` Zhang, XiX
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, XiX @ 2020-01-15  8:52 UTC (permalink / raw)
  To: dts

[-- Attachment #1: Type: text/plain, Size: 3718 bytes --]

Tested  by zhang,xi <xix.zhang@intel.com>

-----Original Message-----
From: Xiao, QimaiX 
Sent: Wednesday, January 15, 2020 4:21 PM
To: Zhang, XiX <xix.zhang@intel.com>
Subject: FW: [dts][PATCH V1]tests/ethtool_stats: add file-prefix to run dpdk-procinfo

> -----Original Message-----
> From: Xiao, QimaiX
> Sent: Tuesday, January 7, 2020 4:47 PM
> To: dts@dpdk.org
> Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
> Subject: [dts][PATCH V1]tests/ethtool_stats: add file-prefix to run 
> dpdk- procinfo
> 
> 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


[-- Attachment #2: TestEthtoolStats.log --]
[-- Type: application/octet-stream, Size: 70589 bytes --]

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

end of thread, back to index

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

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox