test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH]tests multiprocess: fix cmds error while using kill_all
@ 2015-11-27  7:01 Lijuan Tu
  2015-11-27  8:50 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: Lijuan Tu @ 2015-11-27  7:01 UTC (permalink / raw)
  To: dts

Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
 tests/TestSuite_multiprocess.py | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index 7bc005d..e0a6f0e 100644
--- a/tests/TestSuite_multiprocess.py
+++ b/tests/TestSuite_multiprocess.py
@@ -73,7 +73,7 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         """
         Run before each test case.
         """
-        pass
+        self.kill_all()
 
     def test_multiprocess_simple_mpbasicoperation(self):
         """
@@ -106,9 +106,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         Load test of Simple MP application.
         """
 
-        self.dut.kill_all()
-        self.dut.send_expect("fg", "# ")
-
         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", 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)
@@ -129,8 +126,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         Test use of Auto for Application Startup.
         """
 
-        self.dut.kill_all()
-
         # 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)
         self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly")
@@ -164,7 +159,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         Multiple processes without "--proc-type" flag.
         """
 
-        self.dut.kill_all()
         self.dut.alt_session.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)
 
@@ -177,7 +171,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         """
         Benchmark Multiprocess client-server performance.
         """
-        self.dut.kill_all()
         self.dut.send_expect("fg", "# ")
         dutPorts = self.dut.get_ports()
         txPort = self.tester.get_local_port(dutPorts[0])
@@ -247,16 +240,30 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
         self.add_tcl_cmd("stream config -framesize %d" % (len + 18))
         self.add_tcl_cmd("ip set %d %d %d" % (self.chasId, port['card'], port['port']))
 
+    def kill_all(self):
+        """
+        Run after each test case.
+        """
+        try:
+            self.dut.kill_all(False)
+        except Exception as e:
+            msg = str(e)
+            self.logger.warning("session run cmds error")
+            self.logger.warning("**************************************")
+            self.logger.warning(msg)
+            self.logger.warning("**************************************")
+            self.logger.warning("choose alt_session to run cmds again")
+
+            self.dut.kill_all(True)
+
     def tear_down(self):
         """
         Run after each test case.
         """
-        pass
+        self.kill_all()
 
     def tear_down_all(self):
         """
         Run after each test suite.
         """
-        self.dut.kill_all()
-
-        pass
+        self.kill_all()
-- 
1.8.4.2

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

* Re: [dts] [PATCH]tests multiprocess: fix cmds error while using kill_all
  2015-11-27  7:01 [dts] [PATCH]tests multiprocess: fix cmds error while using kill_all Lijuan Tu
@ 2015-11-27  8:50 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2015-11-27  8:50 UTC (permalink / raw)
  To: Tu, LijuanX A, dts

Hi Lijuan, one comment below.

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu
> Sent: Friday, November 27, 2015 3:02 PM
> To: dts@dpdk.org
> Subject: [dts] [PATCH]tests multiprocess: fix cmds error while using
> kill_all
> 
> Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
> ---
>  tests/TestSuite_multiprocess.py | 31 +++++++++++++++++++------------
>  1 file changed, 19 insertions(+), 12 deletions(-)
> 
> diff --git a/tests/TestSuite_multiprocess.py
> b/tests/TestSuite_multiprocess.py
> index 7bc005d..e0a6f0e 100644
> --- a/tests/TestSuite_multiprocess.py
> +++ b/tests/TestSuite_multiprocess.py
> @@ -73,7 +73,7 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
>          """
>          Run before each test case.
>          """
> -        pass
> +        self.kill_all()
> 
>      def test_multiprocess_simple_mpbasicoperation(self):
>          """
> @@ -106,9 +106,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
>          Load test of Simple MP application.
>          """
> 
> -        self.dut.kill_all()
> -        self.dut.send_expect("fg", "# ")
> -
> 
> 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", 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", 100)
> @@ -129,8 +126,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
>          Test use of Auto for Application Startup.
>          """
> 
> -        self.dut.kill_all()
> -
>          # Send message from secondary to primary (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 " % self.target, "Finished Process Init",
> 100)
>          self.verify("EAL: Auto-detected process type: PRIMARY" in out,
> "The type of process (PRIMARY) was not detected properly")
> @@ -164,7 +159,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
>          Multiple processes without "--proc-type" flag.
>          """
> 
> -        self.dut.kill_all()
> 
> self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simpl
> e_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/simp
> le_mp -n 1 -c C" % self.target, "# ", 100)
> 
> @@ -177,7 +171,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator):
>          """
>          Benchmark Multiprocess client-server performance.
>          """
> -        self.dut.kill_all()
>          self.dut.send_expect("fg", "# ")
>          dutPorts = self.dut.get_ports()
>          txPort = self.tester.get_local_port(dutPorts[0])
> @@ -247,16 +240,30 @@ class TestMultiprocess(TestCase,
> IxiaPacketGenerator):
>          self.add_tcl_cmd("stream config -framesize %d" % (len + 18))
>          self.add_tcl_cmd("ip set %d %d %d" % (self.chasId, port['card'],
> port['port']))
> 
> +    def kill_all(self):
> +        """
> +        Run after each test case.
> +        """
> +        try:
> +            self.dut.kill_all(False)
> +        except Exception as e:
> +            msg = str(e)
> +            self.logger.warning("session run cmds error")
> +            self.logger.warning("**************************************")
> +            self.logger.warning(msg)
> +            self.logger.warning("**************************************")
> +            self.logger.warning("choose alt_session to run cmds again")
> +            self.dut.kill_all(True)
> +
Please clear the reason why we need to kill all dpdk process by other session.


>      def tear_down(self):
>          """
>          Run after each test case.
>          """
> -        pass
> +        self.kill_all()
> 
>      def tear_down_all(self):
>          """
>          Run after each test suite.
>          """
> -        self.dut.kill_all()
> -
> -        pass
> +        self.kill_all()
> --
> 1.8.4.2

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

end of thread, other threads:[~2015-11-27  8:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-27  7:01 [dts] [PATCH]tests multiprocess: fix cmds error while using kill_all Lijuan Tu
2015-11-27  8:50 ` 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).