From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 438CF5A31 for ; Fri, 27 Nov 2015 09:50:53 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 27 Nov 2015 00:50:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,351,1444719600"; d="scan'208";a="848077032" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 27 Nov 2015 00:50:49 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 27 Nov 2015 00:50:48 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 27 Nov 2015 00:50:48 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.138]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.88]) with mapi id 14.03.0248.002; Fri, 27 Nov 2015 16:50:27 +0800 From: "Liu, Yong" To: "Tu, LijuanX A" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH]tests multiprocess: fix cmds error while using kill_all Thread-Index: AQHRKOI1/m3R1/0NxEC/Un/qaSJ6oZ6vjT3Q Date: Fri, 27 Nov 2015 08:50:27 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10F705C0@SHSMSX103.ccr.corp.intel.com> References: <1448607710-26950-1-git-send-email-lijuanx.a.tu@intel.com> In-Reply-To: <1448607710-26950-1-git-send-email-lijuanx.a.tu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-inteldataclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsIiwiaWQiOiI4NjE0NTFmNy05NDFiLTQyNWMtOTVkMy0xZjhhODdhYzcwMzIiLCJwcm9wcyI6W3sibiI6IkludGVsRGF0YUNsYXNzaWZpY2F0aW9uIiwidmFscyI6W3sidmFsdWUiOiJDVFBfSUMifV19XX0sIlN1YmplY3RMYWJlbHMiOltdLCJUTUNWZXJzaW9uIjoiMTUuNC4xMC4xOSIsIlRydXN0ZWRMYWJlbEhhc2giOiJRSG4xbmJ1RmpXbXgxS3RjOTU2K1wvYW5VUGUxZ0g2enp3ektXc2I2SDJNbz0ifQ== 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 cmds error while using kill_all 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: Fri, 27 Nov 2015 08:50:54 -0000 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 >=20 > Signed-off-by: Lijuan Tu > --- > tests/TestSuite_multiprocess.py | 31 +++++++++++++++++++------------ > 1 file changed, 19 insertions(+), 12 deletions(-) >=20 > 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() >=20 > def test_multiprocess_simple_mpbasicoperation(self): > """ > @@ -106,9 +106,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/simp= l > e_mp/%s/simple_mp -n 1 -c 3 --proc-type=3Dprimary" % self.target, "Finish= ed > Process Init", 100) > time.sleep(20) >=20 > self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/sim= p > le_mp -n 1 -c C --proc-type=3Dsecondary" % self.target, "Finished Process > Init", 100) > @@ -129,8 +126,6 @@ class 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/sim= p > le_mp -n 1 -c 3 --proc-type=3Dauto " % self.target, "Finished Process Ini= t", > 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. > """ >=20 > - self.dut.kill_all() >=20 > self.dut.alt_session.send_expect("./examples/multi_process/simple_mp/simp= l > e_mp/%s/simple_mp -n 1 -c 3 -m 64" % self.target, "Finished Process Init"= , > 100) > out =3D > self.dut.send_expect("./examples/multi_process/simple_mp/simple_mp/%s/sim= p > le_mp -n 1 -c C" % self.target, "# ", 100) >=20 > @@ -177,7 +171,6 @@ class TestMultiprocess(TestCase, IxiaPacketGenerator)= : > """ > Benchmark Multiprocess client-server performance. > """ > - self.dut.kill_all() > self.dut.send_expect("fg", "# ") > dutPorts =3D self.dut.get_ports() > txPort =3D 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'])) >=20 > + def kill_all(self): > + """ > + Run after each test case. > + """ > + try: > + self.dut.kill_all(False) > + except Exception as e: > + msg =3D 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 sessi= on. > def tear_down(self): > """ > Run after each test case. > """ > - pass > + self.kill_all() >=20 > def tear_down_all(self): > """ > Run after each test suite. > """ > - self.dut.kill_all() > - > - pass > + self.kill_all() > -- > 1.8.4.2