summaryrefslogtreecommitdiff
path: root/tests/TestSuite_multiprocess.py
diff options
context:
space:
mode:
authorMarvin Liu <yong.liu@intel.com>2016-04-22 09:42:47 +0800
committerMarvin Liu <yong.liu@intel.com>2016-04-22 09:42:47 +0800
commit9413f1fc1443d6f737269f88669a32a2313aafbd (patch)
tree68b38ec409e1623727d8f15d9eb9717f639c55ab /tests/TestSuite_multiprocess.py
parente65f16e7d7d2f92bc9cb82d49c706503f2767d30 (diff)
parentadfaa5ba726c535bf96a2ecc9013313b396ed0f3 (diff)
Merge branch 'next'
Diffstat (limited to 'tests/TestSuite_multiprocess.py')
-rw-r--r--tests/TestSuite_multiprocess.py42
1 files 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")