[dts] [PATCH V1]tests/ethtool_stats: add file-prefix to run dpdk-procinfo
Xiao Qimai
qimaix.xiao at intel.com
Tue Jan 7 09:46:53 CET 2020
testpmd launched with file-prefix, so need add this parameter when starting dpdk-procinfo
Signed-off-by: Xiao Qimai <qimaix.xiao at 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
More information about the dts
mailing list