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 A7A7695DC for ; Thu, 26 Nov 2015 01:18:42 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 25 Nov 2015 16:18:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,344,1444719600"; d="scan'208";a="829152133" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 25 Nov 2015 16:18:41 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 25 Nov 2015 16:18:41 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 25 Nov 2015 16:18:40 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.42]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.193]) with mapi id 14.03.0248.002; Thu, 26 Nov 2015 08:18:39 +0800 From: "Tu, LijuanX A" To: "Xu, HuilongX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH]tests multiprocess: fix commands send to wrong session Thread-Index: AQHRJ23Jk2Fhxte8JUSS0qVKvCvwSp6tbbhQ Date: Thu, 26 Nov 2015 00:18:38 +0000 Message-ID: <38D041F150D4184C8114E499040E62340723DE19@shsmsx102.ccr.corp.intel.com> References: <1448441476-4352-1-git-send-email-lijuanx.a.tu@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH]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: Thu, 26 Nov 2015 00:18:43 -0000 Hi ,huilong This bug happened by using kill_all . In the case ,we using alt_session run simple_mp primary ,=20 kill_all send shell-cmd "kill" also using alt_session, so the "kill" was send to dpdk app " simple_mp " . some related log like this: ERROR: lsof -Fp /var/run/.rte_config Command not found simple_mp > ---snip--- buffer (last 100 chars): '-Fp /var/run/.rte_config\r\r\nCommand not found\r= \n\r\nsimple_mp > exit\r\r\nCommand not found\r\n\r\nsimple_mp > ' -----Original Message----- From: Xu, HuilongX=20 Sent: Wednesday, November 25, 2015 6:41 PM To: Tu, LijuanX A; dts@dpdk.org Subject: RE: [dts] [PATCH]tests multiprocess: fix commands send to wrong se= ssion Hi lijuan, Could you used kill_all function for kill dpdk app process, It in crb.py, y= ou can check this function. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu > Sent: Wednesday, November 25, 2015 4:51 PM > To: dts@dpdk.org > Subject: [dts] [PATCH]tests multiprocess: fix commands send to wrong=20 > session >=20 > if alt_session is running app simple_mp kill_all send shell-cmd to=20 > alt_session so exception happened >=20 > Signed-off-by: Lijuan Tu > --- > tests/TestSuite_multiprocess.py | 29 +++++++++++++++++++---------- > 1 file changed, 19 insertions(+), 10 deletions(-) >=20 > diff --git a/tests/TestSuite_multiprocess.py=20 > b/tests/TestSuite_multiprocess.py index 7bc005d..7cce1f4 100644 > --- a/tests/TestSuite_multiprocess.py > +++ b/tests/TestSuite_multiprocess.py > @@ -73,17 +73,33 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator)= : > """ > Run before each test case. > """ > - pass > + self.kill_mp() > + > + def kill_mp(self): > + """ > + Kill all simple_mp applications > + """ > + self.alt_session =3D False > + try: > + out =3D self.dut.send_expect("ps -a |grep simple_mp |awk > '{print $1}'", "# ") > + except: > + self.alt_session =3D True > + out =3D self.dut.alt_session.send_expect("ps -a |grep=20 > + simple_mp > |awk '{print $1}'", "# ") > + if len(out): > + pids =3D out.split('\r\n') > + for pid in pids: > + self.dut.send_expect('kill -9 %s' % pid, '# ', > alt_session=3Dself.alt_session ) > + self.dut.get_session_output(timeout=3D2) >=20 > def test_multiprocess_simple_mpbasicoperation(self): > """ > Basic operation. > """ > + > # Send message from secondary to primary >=20 > self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/ > simp le_mp -n 1 -c 3 --proc-type=3Dprimary" % self.target, "Finished=20 > Process Init", 100) > time.sleep(20) >=20 > self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/s > impl e_mp/%s/simple_mp -n 1 -c C --proc-type=3Dsecondary" % self.target,= =20 > "Finished Process Init", 100) > - > self.dut.alt_session.send_expect("send hello_primary", ">") > out =3D self.dut.get_session_output() > self.dut.alt_session.send_expect("quit", "# ") @@ -106,9=20 > +122,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > Load test of Simple MP application. > """ >=20 > - self.dut.kill_all() > - self.dut.send_expect("fg", "# ") > - >=20 > self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/s > impl e_mp/%s/simple_mp -n 1 -c 3 --proc-type=3Dprimary" % self.target,=20 > "Finished Process Init", 100) > time.sleep(20) >=20 > self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/ > simp le_mp -n 1 -c C --proc-type=3Dsecondary" % self.target, "Finished=20 > Process Init", 100) @@ -129,8 +142,6 @@ class=20 > TestMultiprocess(TestCase, IxiaPacketGenerator): > Test use of Auto for Application Startup. > """ >=20 > - self.dut.kill_all() > - > # Send message from secondary to primary (auto process type) > out =3D > self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/ > simp le_mp -n 1 -c 3 --proc-type=3Dauto " % self.target, "Finished=20 > Process Init", > 100) > self.verify("EAL: Auto-detected process type: PRIMARY" in=20 > out, "The type of process (PRIMARY) was not detected properly") @@=20 > -163,8 +174,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator): > """ > Multiple processes without "--proc-type" flag. > """ > - > - self.dut.kill_all() >=20 > self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/s > impl e_mp/%s/simple_mp -n 1 -c 3 -m 64" % self.target, "Finished=20 > Process Init", > 100) > out =3D > self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/ > simp le_mp -n 1 -c C" % self.target, "# ", 100) >=20 > @@ -257,6 +266,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator)= : > """ > Run after each test suite. > """ > - self.dut.kill_all() > + self.kill_mp() >=20 > pass > -- > 1.9.1