test suite reviews and discussions
 help / color / mirror / Atom feed
From: Gowrishankar <gowrishankar.m@linux.vnet.ibm.com>
To: dts <dts@dpdk.org>
Subject: [dts] [PATCH v2 7/9] tests: fix multiprocess test to set coremask through library
Date: Tue,  8 Mar 2016 15:36:45 +0530	[thread overview]
Message-ID: <1457431607-31596-8-git-send-email-gowrishankar.m@linux.vnet.ibm.com> (raw)
In-Reply-To: <1457431607-31596-1-git-send-email-gowrishankar.m@linux.vnet.ibm.com>

This patch removes fixed core mask values which break PMD to load on unavailable
cpu with in this mask. Instead, use get_core_list and create_mask based on need.

Signed-off-by: Gowrishankar <gowrishankar.m@linux.vnet.ibm.com>
---
 tests/TestSuite_multiprocess.py |   42 ++++++++++++++++++++++++++++-----------
 1 file changed, 30 insertions(+), 12 deletions(-)

diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index 197bdb4..97d3092 100644
--- a/tests/TestSuite_multiprocess.py
+++ b/tests/TestSuite_multiprocess.py
@@ -83,9 +83,12 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         Basic operation.
         """
         # Send message from secondary to primary
-        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary" % self.target, "Finished Process Init", 100)
+        cores = self.dut.get_core_list('1S/2C/1T')
+        coremask = dts.create_mask(cores)
+        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=primary" % (self.target, coremask), "Finished Process Init", 100)
         time.sleep(20)
-        self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=secondary" % self.target, "Finished Process Init", 100)
+        coremask = hex(int(coremask, 16) * 0x10000).rstrip("L")
+        self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=secondary" % (self.target, coremask), "Finished Process Init", 100)
 
         self.session_secondary.send_expect("send hello_primary", ">")
         out = self.dut.get_session_output()
@@ -93,9 +96,12 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         self.dut.send_expect("quit","# ")
         self.verify("Received 'hello_primary'" in out, "Message not received on primary process")
         # Send message from primary to secondary
-        self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary " % self.target, "Finished Process Init", 100)
+        cores = self.dut.get_core_list('1S/2C/1T')
+        coremask = dts.create_mask(cores)
+        self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=primary " % (self.target, coremask), "Finished Process Init", 100)
         time.sleep(20)
-        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=secondary" % self.target, "Finished Process Init", 100)
+        coremask = hex(int(coremask, 16) * 0x10000).rstrip("L")
+        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=secondary" % (self.target, coremask), "Finished Process Init", 100)
         self.session_secondary.send_expect("send hello_secondary", ">")
         out = self.dut.get_session_output()
         self.session_secondary.send_expect("quit", "# ")
@@ -109,9 +115,12 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         Load test of Simple MP application.
         """
 
-        self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary" % self.target, "Finished Process Init", 100)
+        cores = self.dut.get_core_list('1S/2C/1T')
+        coremask = dts.create_mask(cores)
+        self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=primary" % (self.target, coremask), "Finished Process Init", 100)
         time.sleep(20)
-        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=secondary" % self.target, "Finished Process Init", 100)
+        coremask = hex(int(coremask, 16) * 0x10000).rstrip("L")
+        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=secondary" % (self.target, coremask), "Finished Process Init", 100)
         stringsSent = 0
         for line in open('/usr/share/dict/words', 'r').readlines():
             line = line.split('\n')[0]
@@ -130,10 +139,13 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         """
 
         # Send message from secondary to primary (auto process type)
-        out = self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto " % self.target, "Finished Process Init", 100)
+        cores = self.dut.get_core_list('1S/2C/1T')
+        coremask = dts.create_mask(cores)
+        out = self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=auto " % (self.target, coremask), "Finished Process Init", 100)
         self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly")
         time.sleep(20)
-        out = self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=auto" % self.target, "Finished Process Init", 100)
+        coremask = hex(int(coremask, 16) * 0x10000).rstrip("L")
+        out = self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=auto" % (self.target, coremask), "Finished Process Init", 100)
         self.verify("EAL: Auto-detected process type: SECONDARY" in out,
                     "The type of process (SECONDARY) was not detected properly")
 
@@ -144,10 +156,13 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         self.verify("Received 'hello_primary'" in out, "Message not received on primary process")
 
         # Send message from primary to secondary (auto process type)
-        out = self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto" % self.target, "Finished Process Init", 100)
+        cores = self.dut.get_core_list('1S/2C/1T')
+        coremask = dts.create_mask(cores)
+        out = self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=auto" % (self.target, coremask), "Finished Process Init", 100)
         self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly")
         time.sleep(20)
-        out = self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=auto" % self.target, "Finished Process Init", 100)
+        coremask = hex(int(coremask, 16) * 0x10000).rstrip("L")
+        out = self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=auto" % (self.target, coremask), "Finished Process Init", 100)
         self.verify("EAL: Auto-detected process type: SECONDARY" in out, "The type of process (SECONDARY) was not detected properly")
         self.session_secondary.send_expect("send hello_secondary", ">",100)
         out = self.dut.get_session_output()
@@ -162,8 +177,11 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         Multiple processes without "--proc-type" flag.
         """
 
-        self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 -m 64" % self.target, "Finished Process Init", 100)
-        out = self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C" % self.target, "# ", 100)
+        cores = self.dut.get_core_list('1S/2C/1T')
+        coremask = dts.create_mask(cores)
+        self.session_secondary.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s -m 64" % (self.target, coremask), "Finished Process Init", 100)
+        coremask = hex(int(coremask, 16) * 0x10000).rstrip("L")
+        out = self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c %s" % (self.target, coremask), "# ", 100)
 
         self.verify("Is another primary process running" in out,
                     "No other primary process detected")
-- 
1.7.10.4

  parent reply	other threads:[~2016-03-08 10:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 10:06 [dts] framework v2: hugepages, cpuinfo, connect x3 support and bug fixes Gowrishankar
2016-03-08 10:06 ` [dts] [PATCH v2 1/9] framework: check hugepage size and add pages Gowrishankar
2016-03-08 10:06 ` [dts] [PATCH v2 2/9] framework: platform independent cpu info parsing Gowrishankar
2016-03-08 10:06 ` [dts] [PATCH v2 3/9] framework: include domain id in pci tuple Gowrishankar
2016-03-08 10:06 ` [dts] [PATCH v2 4/9] framework: enable connect X3 support Gowrishankar
2016-03-08 10:06 ` [dts] [PATCH v2 5/9] framework: fix numa number lookup for a dev Gowrishankar
2016-03-08 10:06 ` [dts] [PATCH v2 6/9] framework: fix get_core_list to return all lcores Gowrishankar
2016-03-08 10:06 ` Gowrishankar [this message]
2016-03-08 10:06 ` [dts] [PATCH v2 8/9] tests: fix coremask test to check expected EAL output Gowrishankar
2016-03-08 10:06 ` [dts] [PATCH v2 9/9] tests: fix blacklist test to discard extra pci domain id in verification string Gowrishankar
2016-03-09  4:34 ` [dts] framework v2: hugepages, cpuinfo, connect x3 support and bug fixes Liu, Yong
2016-03-10  9:28   ` gowrishankar
2016-03-11  9:26     ` Liu, Yong

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=1457431607-31596-8-git-send-email-gowrishankar.m@linux.vnet.ibm.com \
    --to=gowrishankar.m@linux.vnet.ibm.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).