From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e23smtp04.au.ibm.com (e23smtp04.au.ibm.com [202.81.31.146]) by dpdk.org (Postfix) with ESMTP id B1D1B37AA for ; Tue, 8 Mar 2016 11:08:00 +0100 (CET) Received: from localhost by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Mar 2016 20:07:58 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp04.au.ibm.com (202.81.31.210) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 8 Mar 2016 20:07:55 +1000 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: gowrishankar.m@linux.vnet.ibm.com X-IBM-RcptTo: dts@dpdk.org Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id C3CF22CE8057 for ; Tue, 8 Mar 2016 21:07:55 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u28A7lG81966508 for ; Tue, 8 Mar 2016 21:07:55 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u28A7NcR025752 for ; Tue, 8 Mar 2016 21:07:23 +1100 Received: from chozha.in.ibm.com (chozha.in.ibm.com [9.124.124.138] (may be forged)) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u28A7Dh6024744 for ; Tue, 8 Mar 2016 21:07:22 +1100 From: Gowrishankar To: dts Date: Tue, 8 Mar 2016 15:36:45 +0530 Message-Id: <1457431607-31596-8-git-send-email-gowrishankar.m@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1457431607-31596-1-git-send-email-gowrishankar.m@linux.vnet.ibm.com> References: <1457431607-31596-1-git-send-email-gowrishankar.m@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16030810-0013-0000-0000-000002EA3D25 Subject: [dts] [PATCH v2 7/9] tests: fix multiprocess test to set coremask through library X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2016 10:08:01 -0000 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 --- 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