test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [DTS][PATCH V2] fix multi_process bugs
@ 2015-07-08  9:15 Haifeng Tang
  2015-07-08  9:23 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: Haifeng Tang @ 2015-07-08  9:15 UTC (permalink / raw)
  To: dts; +Cc: jingguox.fu

From: TangHaifeng <haifengx.tang@intel.com>


Signed-off-by: TangHaifeng <haifengx.tang@intel.com>
---
 tests/TestSuite_multiprocess.py |   39 +++++++++++++++------------------------
 1 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index 4ef5313..a19967c 100644
--- a/tests/TestSuite_multiprocess.py
+++ b/tests/TestSuite_multiprocess.py
@@ -37,7 +37,6 @@ Multi-process Test.
 import dts
 import time
 from etgen import IxiaPacketGenerator
-
 executions = []
 from test_case import TestCase
 
@@ -68,6 +67,7 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         executions.append({'nprocs': 4, 'cores': '1S/2C/2T', 'pps': 0})
         executions.append({'nprocs': 4, 'cores': '1S/4C/1T', 'pps': 0})
         executions.append({'nprocs': 8, 'cores': '1S/4C/2T', 'pps': 0})
+        self.dut.alt_session.send_expect("cd dpdk","# ",5)
 
     def set_up(self):
         """
@@ -79,28 +79,22 @@ 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 > out &" % self.target, "# ", 10)
+        self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary |tee out  " % self.target, "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", 10)
+        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)
 
         self.dut.send_expect("send hello_primary", ">")
         self.dut.send_expect("quit", "# ")
-        self.dut.send_expect("fg", "simple_mp")
-        self.dut.send_expect("quit", "# ")
-        out = self.dut.send_expect("cat out", "# ")
-
+        self.dut.alt_session.send_expect("quit","# ")
+        out = self.dut.alt_session.send_expect("cat out","# ")
         self.verify("Received 'hello_primary'" in out, "Message not received on primary process")
-
         # Send message from primary to secondary
-        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary &" % self.target, "# ", 10)
+        self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary " % self.target, "Finished Process Init", 10)
         time.sleep(20)
-        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=secondary > out &" % self.target, "Finished Process Init", 10)
-        self.dut.send_expect("fg 1", "simple_mp")
-        self.dut.send_expect("send hello_secondary", ">")
-        self.dut.send_expect("quit", "# ")
-        self.dut.send_expect("fg 2", "simple_mp")
+        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=secondary | tee out  " % self.target, "Finished Process Init", 10)
+        self.dut.alt_session.send_expect("send hello_secondary", ">")
+        self.dut.alt_session.send_expect("quit", "# ")
         self.dut.send_expect("quit", "# ")
         out = self.dut.send_expect("cat out", "# ")
 
@@ -138,7 +132,7 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         self.dut.kill_all()
 
         # Send message from secondary to primary (auto process type)
-        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto > out &" % self.target, "# ", 30)
+        self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto |tee out " % self.target, "Finished Process Init", 30)
         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", 30)
         self.verify("EAL: Auto-detected process type: SECONDARY" in out,
@@ -146,21 +140,18 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
 
         self.dut.send_expect("send hello_primary", ">")
         self.dut.send_expect("quit", "# ")
-        self.dut.send_expect("fg", "simple_mp")
-        self.dut.send_expect("quit", "# ")
+        self.dut.alt_session.send_expect("quit", "# ")
         out = self.dut.send_expect("cat out", "# ")
 
         self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly")
         self.verify("Received 'hello_primary'" in out, "Message not received on primary process")
 
         # Send message from primary to secondary (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 > out_primary &" % self.target, "# ", 30)
+        out = self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto |tee out_primary " % self.target, "Finished Process Init", 30)
         time.sleep(20)
-        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=auto > out_secondary &" % self.target, "#", 30)
-        self.dut.send_expect("fg 1", "simple_mp")
-        self.dut.send_expect("send hello_secondary", ">")
-        self.dut.send_expect("quit", "# ")
-        self.dut.send_expect("fg 2", "simple_mp")
+        self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simple_mp -n 1 -c C --proc-type=auto |tee out_secondary " % self.target, "Finished Process Init", 30)
+        self.dut.alt_session.send_expect("send hello_secondary", ">",100)
+        self.dut.alt_session.send_expect("quit", "# ")
         self.dut.send_expect("quit", "# ")
         out = self.dut.send_expect("cat out_primary", "# ")
         self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly")
-- 
1.7.4.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [DTS][PATCH V2] fix multi_process bugs
  2015-07-08  9:15 [dts] [DTS][PATCH V2] fix multi_process bugs Haifeng Tang
@ 2015-07-08  9:23 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2015-07-08  9:23 UTC (permalink / raw)
  To: Tang, HaifengX, dts; +Cc: Fu, JingguoX

Thanks, applied in 1.1 branch.

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Haifeng Tang
> Sent: Wednesday, July 08, 2015 5:16 PM
> To: dts@dpdk.org
> Cc: Fu, JingguoX
> Subject: [dts] [DTS][PATCH V2] fix multi_process bugs
> 
> From: TangHaifeng <haifengx.tang@intel.com>
> 
> 
> Signed-off-by: TangHaifeng <haifengx.tang@intel.com>
> ---
>  tests/TestSuite_multiprocess.py |   39 +++++++++++++++-------------------
> -----
>  1 files changed, 15 insertions(+), 24 deletions(-)
> 
> diff --git a/tests/TestSuite_multiprocess.py
> b/tests/TestSuite_multiprocess.py
> index 4ef5313..a19967c 100644
> --- a/tests/TestSuite_multiprocess.py
> +++ b/tests/TestSuite_multiprocess.py
> @@ -37,7 +37,6 @@ Multi-process Test.
>  import dts
>  import time
>  from etgen import IxiaPacketGenerator
> -
>  executions = []
>  from test_case import TestCase
> 
> @@ -68,6 +67,7 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
>          executions.append({'nprocs': 4, 'cores': '1S/2C/2T', 'pps': 0})
>          executions.append({'nprocs': 4, 'cores': '1S/4C/1T', 'pps': 0})
>          executions.append({'nprocs': 8, 'cores': '1S/4C/2T', 'pps': 0})
> +        self.dut.alt_session.send_expect("cd dpdk","# ",5)
> 
>      def set_up(self):
>          """
> @@ -79,28 +79,22 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
>          """
>          Basic operation.
>          """
> -
>          # Send message from secondary to primary
> -
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c 3 --proc-type=primary > out &" % self.target, "# ", 10)
> +
> self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simpl
> e_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary |tee out  " % self.target,
> "Finished Process Init", 100)
>          time.sleep(20)
> -
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c C --proc-type=secondary" % self.target, "Finished Process
> Init", 10)
> +
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c C --proc-type=secondary" % self.target, "Finished Process
> Init", 100)
> 
>          self.dut.send_expect("send hello_primary", ">")
>          self.dut.send_expect("quit", "# ")
> -        self.dut.send_expect("fg", "simple_mp")
> -        self.dut.send_expect("quit", "# ")
> -        out = self.dut.send_expect("cat out", "# ")
> -
> +        self.dut.alt_session.send_expect("quit","# ")
> +        out = self.dut.alt_session.send_expect("cat out","# ")
>          self.verify("Received 'hello_primary'" in out, "Message not
> received on primary process")
> -
>          # Send message from primary to secondary
> -
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c 3 --proc-type=primary &" % self.target, "# ", 10)
> +
> self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simpl
> e_mp/%s/simple_mp -n 1 -c 3 --proc-type=primary " % self.target, "Finished
> Process Init", 10)
>          time.sleep(20)
> -
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c C --proc-type=secondary > out &" % self.target, "Finished
> Process Init", 10)
> -        self.dut.send_expect("fg 1", "simple_mp")
> -        self.dut.send_expect("send hello_secondary", ">")
> -        self.dut.send_expect("quit", "# ")
> -        self.dut.send_expect("fg 2", "simple_mp")
> +
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c C --proc-type=secondary | tee out  " % self.target,
> "Finished Process Init", 10)
> +        self.dut.alt_session.send_expect("send hello_secondary", ">")
> +        self.dut.alt_session.send_expect("quit", "# ")
>          self.dut.send_expect("quit", "# ")
>          out = self.dut.send_expect("cat out", "# ")
> 
> @@ -138,7 +132,7 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
>          self.dut.kill_all()
> 
>          # Send message from secondary to primary (auto process type)
> -
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c 3 --proc-type=auto > out &" % self.target, "# ", 30)
> +
> self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simpl
> e_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto |tee out " % self.target,
> "Finished Process Init", 30)
>          time.sleep(20)
>          out =
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c C --proc-type=auto" % self.target, "Finished Process Init",
> 30)
>          self.verify("EAL: Auto-detected process type: SECONDARY" in out,
> @@ -146,21 +140,18 @@ class TestMultiprocess(TestCase,
> IxiaPacketGenerator):
> 
>          self.dut.send_expect("send hello_primary", ">")
>          self.dut.send_expect("quit", "# ")
> -        self.dut.send_expect("fg", "simple_mp")
> -        self.dut.send_expect("quit", "# ")
> +        self.dut.alt_session.send_expect("quit", "# ")
>          out = self.dut.send_expect("cat out", "# ")
> 
>          self.verify("EAL: Auto-detected process type: PRIMARY" in out,
> "The type of process (PRIMARY) was not detected properly")
>          self.verify("Received 'hello_primary'" in out, "Message not
> received on primary process")
> 
>          # Send message from primary to secondary (auto process type)
> -        out =
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c 3 --proc-type=auto > out_primary &" % self.target, "# ", 30)
> +        out =
> self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simpl
> e_mp/%s/simple_mp -n 1 -c 3 --proc-type=auto |tee out_primary " %
> self.target, "Finished Process Init", 30)
>          time.sleep(20)
> -
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c C --proc-type=auto > out_secondary &" % self.target, "#", 30)
> -        self.dut.send_expect("fg 1", "simple_mp")
> -        self.dut.send_expect("send hello_secondary", ">")
> -        self.dut.send_expect("quit", "# ")
> -        self.dut.send_expect("fg 2", "simple_mp")
> +
> self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/simp
> le_mp -n 1 -c C --proc-type=auto |tee out_secondary " % self.target,
> "Finished Process Init", 30)
> +        self.dut.alt_session.send_expect("send hello_secondary", ">",100)
> +        self.dut.alt_session.send_expect("quit", "# ")
>          self.dut.send_expect("quit", "# ")
>          out = self.dut.send_expect("cat out_primary", "# ")
>          self.verify("EAL: Auto-detected process type: PRIMARY" in out,
> "The type of process (PRIMARY) was not detected properly")
> --
> 1.7.4.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-08  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-08  9:15 [dts] [DTS][PATCH V2] fix multi_process bugs Haifeng Tang
2015-07-08  9:23 ` Liu, Yong

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