test suite reviews and discussions
 help / color / mirror / Atom feed
From: Zhou Jun <junx.w.zhou@intel.com>
To: dts@dpdk.org
Cc: Zhou Jun <junx.w.zhou@intel.com>
Subject: [dts] [PATCH V1] tests/TestSuite_distributor:Modify the hard coded appparameter
Date: Thu, 10 Dec 2020 19:25:32 +0800	[thread overview]
Message-ID: <20201210112532.21961-1-junx.w.zhou@intel.com> (raw)

Modify the hard coded appparameter to call the platform interface

Signed-off-by: Zhou Jun <junx.w.zhou@intel.com>
---
 tests/TestSuite_distributor.py | 33 ++++++++++++++-------------------
 1 file changed, 14 insertions(+), 19 deletions(-)

diff --git a/tests/TestSuite_distributor.py b/tests/TestSuite_distributor.py
index e5a8454e..2bfe6ee6 100644
--- a/tests/TestSuite_distributor.py
+++ b/tests/TestSuite_distributor.py
@@ -76,7 +76,8 @@ class TestDistributor(TestCase):
         """
         Run distributor unit test
         """
-        self.dut.send_expect("./%s -n 1 -c f" % self.app_test_path, "RTE>>", 60)
+        eal_para = self.dut.create_eal_parameters(cores=[0, 1, 2, 3])
+        self.dut.send_expect("./%s %s" % (self.app_test_path, eal_para), "RTE>>", 60)
         out = self.dut.send_expect("distributor_autotest", "RTE>>", 30)
         self.dut.send_expect("quit", "# ")
         self.verify("Test OK" in out, "Test failed")
@@ -85,7 +86,8 @@ class TestDistributor(TestCase):
         """
         Run distributor unit perf test
         """
-        self.dut.send_expect("./%s -n 1 -c f" % self.app_test_path, "RTE>>", 60)
+        eal_para = self.dut.create_eal_parameters(cores=[0, 1, 2, 3])
+        self.dut.send_expect("./%s %s" % (self.app_test_path, eal_para), "RTE>>", 60)
         out = self.dut.send_expect("distributor_perf_autotest", "RTE>>", 120)
         cycles_single = self.strip_cycles(out, "single")
         cycles_burst = self.strip_cycles(out, "burst")
@@ -112,7 +114,7 @@ class TestDistributor(TestCase):
                         "Throughput Rate Pkts out line rate"]
 
         # output port is calculated from overall ports number
-        cmd_fmt = "%s -c %s -n %d -w %s -- -p 0x1"
+        cmd_fmt = "%s %s -- -p 0x1"
         socket = self.dut.get_numa_id(self.dut_ports[0])
 
         pcap = os.sep.join([self.output_path, "distributor.pcap"])
@@ -133,10 +135,8 @@ class TestDistributor(TestCase):
             if len(cores) < (worker_num + 4):
                 cores = self._get_thread_lcore(worker_num + 4)
 
-            cmd = cmd_fmt % (self.app_distributor_path, utils.create_mask(cores),
-                             self.dut.get_memory_channels(),
-                             self.dut.get_port_pci(self.dut_ports[0]))
-
+            eal_para = self.dut.create_eal_parameters(cores=cores, ports=[0])
+            cmd = cmd_fmt % (self.app_distributor_path, eal_para)
             self.dut.send_expect(cmd, "doing packet RX", timeout=30)
 
             # clear streams before add new streams
@@ -163,8 +163,8 @@ class TestDistributor(TestCase):
         Check distributor app work fine with maximum workers
         """
         self.verify(len(self.dut_ports) >= 1, "Not enough ports")
-        cmd_fmt = "%s -c %s -n %d -w %s -- -p 0x1"
 
+        cmd_fmt = "%s %s -- -p 0x1"
         out = self.dut.send_expect("sed -n '/#define RTE_DISTRIB_MAX_WORKERS/p' lib/librte_distributor/distributor_private.h", "# ")
         reg_match = r"#define RTE_DISTRIB_MAX_WORKERS (.*)"
         m = re.match(reg_match, out)
@@ -172,11 +172,8 @@ class TestDistributor(TestCase):
 
         max_workers = int(m.group(1))
         cores = self._get_thread_lcore(max_workers - 1 + 4)
-
-        cmd = cmd_fmt % (self.app_distributor_path, utils.create_mask(cores),
-                         self.dut.get_memory_channels(),
-                         self.dut.get_port_pci(self.dut_ports[0]))
-
+        eal_para = self.dut.create_eal_parameters(cores=cores, ports=[0])
+        cmd = cmd_fmt % (self.app_distributor_path, eal_para)
         self.dut.send_expect(cmd, "doing packet RX", timeout=30)
 
         tx_port = self.tester.get_local_port(self.dut_ports[0])
@@ -190,15 +187,13 @@ class TestDistributor(TestCase):
         Check distributor app work fine with multiple ports
         """
         self.verify(len(self.dut_ports) >= 2, "Not enough ports")
-        cmd_fmt = "%s -c %s -n %d -w %s -w %s -- -p 0x3"
+
+        cmd_fmt = "%s %s -- -p 0x3"
         socket = self.dut.get_numa_id(self.dut_ports[0])
         cores = self.dut.get_core_list("1S/%dC/1T" % (2 + 4), socket)
 
-        cmd = cmd_fmt % (self.app_distributor_path, utils.create_mask(cores),
-                         self.dut.get_memory_channels(),
-                         self.dut.get_port_pci(self.dut_ports[0]),
-                         self.dut.get_port_pci(self.dut_ports[1]))
-
+        eal_para = self.dut.create_eal_parameters(cores=cores, ports=[0,1])
+        cmd = cmd_fmt % (self.app_distributor_path, eal_para)
         self.dut.send_expect(cmd, "doing packet RX", timeout=30)
 
         tx_port = self.tester.get_local_port(self.dut_ports[0])
-- 
2.17.1


             reply	other threads:[~2020-12-10 11:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 11:25 Zhou Jun [this message]
2020-12-15  5:52 ` Tu, Lijuan

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=20201210112532.21961-1-junx.w.zhou@intel.com \
    --to=junx.w.zhou@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).