From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D6321A04F7; Fri, 20 Dec 2019 09:05:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C11FF1C01; Fri, 20 Dec 2019 09:05:09 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 54247F90 for ; Fri, 20 Dec 2019 09:05:08 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2019 00:05:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,335,1571727600"; d="scan'208";a="416460814" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 20 Dec 2019 00:05:06 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 20 Dec 2019 00:05:06 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 20 Dec 2019 00:05:06 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.19]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.71]) with mapi id 14.03.0439.000; Fri, 20 Dec 2019 16:05:04 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/multiple_pthread: fix issue of always send pkts after this suite Thread-Index: AQHVtKzXItWAWaiSRUy//iVvNBWRjKfCrvtA Date: Fri, 20 Dec 2019 08:05:03 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB8A1D8@SHSMSX101.ccr.corp.intel.com> References: <1576541483-27982-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1576541483-27982-1-git-send-email-lihongx.ma@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action 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 V1] tests/multiple_pthread: fix issue of always send pkts after this suite 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: Tuesday, December 17, 2019 8:11 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/multiple_pthread: fix issue of always sen= d > pkts after this suite >=20 > Signed-off-by: lihong > --- > tests/TestSuite_multiple_pthread.py | 25 ++++++++++--------------- > 1 file changed, 10 insertions(+), 15 deletions(-) >=20 > diff --git a/tests/TestSuite_multiple_pthread.py > b/tests/TestSuite_multiple_pthread.py > index b59f047..6c6a070 100644 > --- a/tests/TestSuite_multiple_pthread.py > +++ b/tests/TestSuite_multiple_pthread.py > @@ -36,6 +36,7 @@ import random > import string > import utils > from test_case import TestCase > +from packet import Packet >=20 >=20 > class TestMultiplePthread(TestCase): > @@ -60,27 +61,19 @@ class TestMultiplePthread(TestCase): > """ > Run before each test case. > """ > - pass > - > - def destroy_packets_session(self): > - """ > - close send packets session. > - """ > - for i in valports: > - self.tester.create_session(name=3D"%s" % i).send_expect("^C"= , "#") > - self.tester.destroy_session(self.tester.create_session(name= =3D"%s" % i)) > + self.send_sessions =3D [] >=20 > def send_packet(self): > """ > - create sessions and Send packets continuous. > + Send packets continuous. > """ > for index in valports: > localPort =3D self.tester.get_local_port(index) > iface =3D self.tester.get_interface(localPort) > - self.send_packets_session =3D self.tester.create_session(nam= e=3D"%s" % > index) > - packet =3D r'sendp([Ether()/IP(src=3D"1.2.3.4", dst=3D"192.1= 68.0.%d")], > iface=3D"%s", loop=3D1)' % (index, iface) > - self.send_packets_session.send_expect("scapy", ">>>") > - self.send_packets_session.send_command(packet) > + pcap_str =3D 'Ether()/IP(src=3D"1.2.3.4", dst=3D"192.168.0.%= d")' % (index) > + self.pkt =3D Packet(pcap_str) > + intf =3D self.pkt.send_pkt_bg(crb=3Dself.tester, tx_port=3Di= face) > + self.send_sessions.append(intf) >=20 > def get_cores_statistic(self, cmdline): > """ > @@ -91,6 +84,7 @@ class TestMultiplePthread(TestCase): > m =3D cmdline.replace('"', '', 2) > out_list =3D out.split(m) > mutiple_pthread_session.send_expect("^C", "#") > + self.dut.close_session(mutiple_pthread_session) > return out_list >=20 > def verify_before_send_packets(self, out_list): > @@ -159,7 +153,6 @@ class TestMultiplePthread(TestCase): > # quit application > self.dut.send_expect("stop", "testpmd> ") > self.dut.send_expect("quit", "# ", 30) > - self.destroy_packets_session() >=20 > def test_basic_operation(self): > """ > @@ -231,6 +224,8 @@ class TestMultiplePthread(TestCase): > """ > Run after each test case. > """ > + if len(self.send_sessions) !=3D 0: > + self.pkt.stop_send_pkt_bg(self.tester, self.send_sessions) > self.dut.kill_all() >=20 > def tear_down_all(self): > -- > 2.7.4