test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yu Jiang <yux.jiang@intel.com>
To: lijuan.tu@intel.com, dts@dpdk.org
Cc: Yu Jiang <yux.jiang@intel.com>
Subject: [dts][PATCH V1 4/4] tests/multiple_pthread: support eal_param -a to avoid running containers conflict
Date: Wed, 24 May 2023 11:33:28 +0800	[thread overview]
Message-ID: <20230524033328.2146223-5-yux.jiang@intel.com> (raw)
In-Reply-To: <20230524033328.2146223-1-yux.jiang@intel.com>

Support eal_param -a to avoid running containers conflict

Signed-off-by: Yu Jiang <yux.jiang@intel.com>
---
 tests/TestSuite_multiple_pthread.py | 46 +++++++++++++++++------------
 1 file changed, 27 insertions(+), 19 deletions(-)

diff --git a/tests/TestSuite_multiple_pthread.py b/tests/TestSuite_multiple_pthread.py
index 253d6a4a..6c15077f 100644
--- a/tests/TestSuite_multiple_pthread.py
+++ b/tests/TestSuite_multiple_pthread.py
@@ -23,6 +23,9 @@ class TestMultiplePthread(TestCase):
             "Test suite currently only supports Linux platforms",
         )
         self.dut_ports = self.dut.get_ports(self.nic)
+        self.eal_param_a = ""
+        for i in self.dut_ports:
+            self.eal_param_a += " -a {}".format(self.dut.ports_info[i]["pci"])
         global valports
         valports = [_ for _ in self.dut_ports if self.tester.get_local_port(_) != -1]
         # Verify that enough ports are available
@@ -110,14 +113,19 @@ class TestMultiplePthread(TestCase):
         # Allocate enough streams based on the number of CPUs
         if len(cpu_list) > 2:
             queue_num = len(cpu_list)
-            cmdline = './%s --lcores="%s" -n 4 -- -i --txq=%d --rxq=%d' % (
+            cmdline = './%s%s --lcores="%s" -n 4 -- -i --txq=%d --rxq=%d' % (
                 self.path,
+                self.eal_param_a,
                 lcores,
                 queue_num,
                 queue_num,
             )
         else:
-            cmdline = './%s --lcores="%s" -n 4 -- -i' % (self.path, lcores)
+            cmdline = './%s%s --lcores="%s" -n 4 -- -i' % (
+                self.path,
+                self.eal_param_a,
+                lcores,
+            )
         # start application
         self.dut.send_expect(cmdline, "testpmd", 60)
 
@@ -229,26 +237,26 @@ class TestMultiplePthread(TestCase):
         Test an random parameter from an defined table which has a couple of invalid lcore parameters.
         """
         cmdline_list = [
-            "./%s --lcores='(0-,4-7)@(4,5)' -n 4 -- -i",
-            "./%s --lcores='(-1,4-7)@(4,5)' -n 4 -- -i",
-            "./%s --lcores='(0,4-7-9)@(4,5)' -n 4 -- -i",
-            "./%s --lcores='(0,abcd)@(4,5)' -n 4 -- -i",
-            "./%s --lcores='(0,4-7)@(1-,5)' -n 4 -- -i",
-            "./%s --lcores='(0,4-7)@(-1,5)' -n 4 -- -i",
-            "./%s --lcores='(0,4-7)@(4,5-8-9)' -n 4 -- -i",
-            "./%s --lcores='(0,4-7)@(abc,5)' -n 4 -- -i",
-            "./%s --lcores='(0,4-7)@(4,xyz)' -n 4 -- -i",
-            "./%s --lcores='(0,4-7)=(8,9)' -n 4 -- -i",
-            "./%s --lcores='2,3 at 4,(0-1,,4))' -n 4 -- -i",
-            "./%s --lcores='[0-,4-7]@(4,5)' -n 4 -- -i",
-            "./%s --lcores='(0-,4-7)@[4,5]' -n 4 -- -i",
-            "./%s --lcores='3-4 at 3,2 at 5-6' -n 4 -- -i",
-            "./%s --lcores='2,,3''2--3' -n 4 -- -i",
-            "./%s --lcores='2,,,3''2--3' -n 4 -- -i",
+            "./%s%s --lcores='(0-,4-7)@(4,5)' -n 4 -- -i",
+            "./%s%s --lcores='(-1,4-7)@(4,5)' -n 4 -- -i",
+            "./%s%s --lcores='(0,4-7-9)@(4,5)' -n 4 -- -i",
+            "./%s%s --lcores='(0,abcd)@(4,5)' -n 4 -- -i",
+            "./%s%s --lcores='(0,4-7)@(1-,5)' -n 4 -- -i",
+            "./%s%s --lcores='(0,4-7)@(-1,5)' -n 4 -- -i",
+            "./%s%s --lcores='(0,4-7)@(4,5-8-9)' -n 4 -- -i",
+            "./%s%s --lcores='(0,4-7)@(abc,5)' -n 4 -- -i",
+            "./%s%s --lcores='(0,4-7)@(4,xyz)' -n 4 -- -i",
+            "./%s%s --lcores='(0,4-7)=(8,9)' -n 4 -- -i",
+            "./%s%s --lcores='2,3 at 4,(0-1,,4))' -n 4 -- -i",
+            "./%s%s --lcores='[0-,4-7]@(4,5)' -n 4 -- -i",
+            "./%s%s --lcores='(0-,4-7)@[4,5]' -n 4 -- -i",
+            "./%s%s --lcores='3-4 at 3,2 at 5-6' -n 4 -- -i",
+            "./%s%s --lcores='2,,3''2--3' -n 4 -- -i",
+            "./%s%s --lcores='2,,,3''2--3' -n 4 -- -i",
         ]
 
         cmdline = random.sample(cmdline_list, 1)
-        out = self.dut.send_expect(cmdline[0] % self.path, "#", 60)
+        out = self.dut.send_expect(cmdline[0] % (self.path, self.eal_param_a), "#", 60)
         self.verify("invalid parameter" in out, "it's a valid parameter")
 
     def tear_down(self):
-- 
2.25.1


  parent reply	other threads:[~2023-05-24  3:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24  3:33 [dts][PATCH V1 0/4] Support eal_param -a to avoid running containers Yu Jiang
2023-05-24  3:33 ` [dts][PATCH V1 1/4] tests/coremask: support eal_param -a to avoid running containers conflict Yu Jiang
2023-05-24  3:33 ` [dts][PATCH V1 2/4] tests/ethtool_stats: " Yu Jiang
2023-05-24  3:33 ` [dts][PATCH V1 3/4] tests/external_mempool_handler: " Yu Jiang
2023-05-24  3:33 ` Yu Jiang [this message]
2023-05-25  2:36   ` [dts][PATCH V1 4/4] tests/multiple_pthread: " lijuan.tu

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=20230524033328.2146223-5-yux.jiang@intel.com \
    --to=yux.jiang@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    /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).