From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D4F6658CF for ; Mon, 14 Dec 2015 02:05:29 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 13 Dec 2015 17:05:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,424,1444719600"; d="scan'208";a="870754760" Received: from stv-crb-56.sh.intel.com (HELO [10.239.128.116]) ([10.239.128.116]) by orsmga002.jf.intel.com with ESMTP; 13 Dec 2015 17:05:29 -0800 Message-ID: <566E15B1.1010409@intel.com> Date: Mon, 14 Dec 2015 09:04:49 +0800 From: "Liu, Yong" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Lijuan Tu , dts@dpdk.org References: <1449817860-5868-1-git-send-email-lijuanx.a.tu@intel.com> In-Reply-To: <1449817860-5868-1-git-send-email-lijuanx.a.tu@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dts] [PATCH v3]tests multiprocess: fix commands send to wrong session 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: Mon, 14 Dec 2015 01:05:30 -0000 Applied. Thanks. On 12/11/2015 03:11 PM, Lijuan Tu wrote: > From: lijuan tu > > create a new session to run secondary process > > Signed-off-by: lijuan tu > --- > tests/TestSuite_multiprocess.py | 43 ++++++++++++++++++++--------------------- > 1 file changed, 21 insertions(+), 22 deletions(-) > > diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py > index 7bc005d..197bdb4 100644 > --- a/tests/TestSuite_multiprocess.py > +++ b/tests/TestSuite_multiprocess.py > @@ -69,6 +69,9 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > executions.append({'nprocs': 8, 'cores': '1S/4C/2T', 'pps': 0}) > self.dut.alt_session.send_expect("cd dpdk","# ",5) > > + # start new session to run secondary > + self.session_secondary = self.dut.new_session() > + > def set_up(self): > """ > Run before each test case. > @@ -82,20 +85,20 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > # 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) > time.sleep(20) > - self.dut.alt_session.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.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) > > - self.dut.alt_session.send_expect("send hello_primary", ">") > + self.session_secondary.send_expect("send hello_primary", ">") > out = self.dut.get_session_output() > - self.dut.alt_session.send_expect("quit", "# ") > + self.session_secondary.send_expect("quit", "# ") > 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.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) > + 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) > 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) > - self.dut.alt_session.send_expect("send hello_secondary", ">") > + self.session_secondary.send_expect("send hello_secondary", ">") > out = self.dut.get_session_output() > - self.dut.alt_session.send_expect("quit", "# ") > + self.session_secondary.send_expect("quit", "# ") > self.dut.send_expect("quit", "# ") > > self.verify("Received 'hello_secondary'" in out, > @@ -106,10 +109,7 @@ 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) > + 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) > 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) > stringsSent = 0 > @@ -122,38 +122,36 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > > time.sleep(5) > self.dut.send_expect("quit", "# ") > - self.dut.alt_session.send_expect("quit", "# ") > + self.session_secondary.send_expect("quit", "# ") > > def test_multiprocess_simple_mpapplicationstartup(self): > """ > 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") > time.sleep(20) > - out = self.dut.alt_session.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) > + 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) > self.verify("EAL: Auto-detected process type: SECONDARY" in out, > "The type of process (SECONDARY) was not detected properly") > > - self.dut.alt_session.send_expect("send hello_primary", ">") > + self.session_secondary.send_expect("send hello_primary", ">") > out = self.dut.get_session_output() > - self.dut.alt_session.send_expect("quit", "# ") > + self.session_secondary.send_expect("quit", "# ") > self.dut.send_expect("quit", "# ") > 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.alt_session.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) > + 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) > 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) > self.verify("EAL: Auto-detected process type: SECONDARY" in out, "The type of process (SECONDARY) was not detected properly") > - self.dut.alt_session.send_expect("send hello_secondary", ">",100) > + self.session_secondary.send_expect("send hello_secondary", ">",100) > out = self.dut.get_session_output() > - self.dut.alt_session.send_expect("quit", "# ") > + self.session_secondary.send_expect("quit", "# ") > self.dut.send_expect("quit", "# ") > > self.verify("Received 'hello_secondary'" in out, > @@ -164,14 +162,13 @@ 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) > + 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) > > self.verify("Is another primary process running" in out, > "No other primary process detected") > > - self.dut.alt_session.send_expect("quit", "# ") > + self.session_secondary.send_expect("quit", "# ") > > def test_perf_multiprocess_client_serverperformance(self): > """ > @@ -251,6 +248,7 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > """ > Run after each test case. > """ > + self.dut.kill_all() > pass > > def tear_down_all(self): > @@ -258,5 +256,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > Run after each test suite. > """ > self.dut.kill_all() > + self.dut.close_session(self.session_secondary) > > pass