[V1,4/4] tests/multiple_pthread: support eal_param -a to avoid running containers conflict

Message ID 20230524033328.2146223-5-yux.jiang@intel.com (mailing list archive)
State Accepted
Headers
Series Support eal_param -a to avoid running containers |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-suite-test success Testing OK

Commit Message

Jiang, YuX May 24, 2023, 3:33 a.m. UTC
  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(-)
  

Comments

Tu, Lijuan May 25, 2023, 2:36 a.m. UTC | #1
On Wed, 24 May 2023 11:33:28 +0800, Yu Jiang <yux.jiang@intel.com> wrote:
> Support eal_param -a to avoid running containers conflict
> 
> Signed-off-by: Yu Jiang <yux.jiang@intel.com>

Reviewed-by: Lijuan Tu <lijuan.tu@intel.com>
Series applied, thanks
  

Patch

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):