From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B1EE62C16 for ; Tue, 11 Dec 2018 11:52:51 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2018 02:52:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,342,1539673200"; d="scan'208";a="99781593" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 11 Dec 2018 02:52:50 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 11 Dec 2018 02:52:50 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 11 Dec 2018 02:52:50 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.201]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.203]) with mapi id 14.03.0415.000; Tue, 11 Dec 2018 18:52:48 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V2] Use tcpdump_sniff_packets instead of sniff method Thread-Index: AQHUkPKHixf9y/JvdkKeS4IjJ7cGeqV5XRzA Date: Tue, 11 Dec 2018 10:52:47 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0B9DEEF5@SHSMSX101.ccr.corp.intel.com> References: <1544466259-26531-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1544466259-26531-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.0.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODVhOTc1OWQtYzg3Ni00YTk4LTlmODktNTMyOTg5OGZmNjdhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiT0ZsS0VKdmlnXC9LSTZ5enJjajJQZWdyTnRHaFJhczFpMnVHTjVnNWdnQXQ0YW9pWTZcL1Q0eFBRcUFQYWxEazFjIn0= 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 V2] Use tcpdump_sniff_packets instead of sniff method 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: Tue, 11 Dec 2018 10:52:52 -0000 Applied V2, and supersede V1, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: Tuesday, December 11, 2018 2:24 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V2] Use tcpdump_sniff_packets instead of sniff > method >=20 > The sniff method may not work well when add filter ether arguments, so us= e > tcpdump_sniff_packets instead of it. >=20 > Signed-off-by: lihong > --- > tests/TestSuite_short_live.py | 9 ++++----- > tests/TestSuite_vxlan.py | 8 +++----- > 2 files changed, 7 insertions(+), 10 deletions(-) >=20 > diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.p= y > index ca3643f..b3ec131 100644 > --- a/tests/TestSuite_short_live.py > +++ b/tests/TestSuite_short_live.py > @@ -102,10 +102,7 @@ class TestShortLiveApp(TestCase): > if (txPort =3D=3D rxPort): > count =3D 2 >=20 > - self.tester.scapy_append('p=3Dsniff(iface=3D"%s", > filter=3D"ether[12:2]!=3D0x88cc", count=3D%d, timeout=3D5)' % (rxitf, cou= nt)) > - self.tester.scapy_append('RESULT=3Dstr(p[%d].show)' % (count-1)) > - > - self.tester.scapy_foreground() > + inst =3D self.tester.tcpdump_sniff_packets(rxitf, count=3Dcount, > + timeout=3D5) >=20 > pktlen =3D pktSize - 14 > padding =3D pktlen - 20 > @@ -114,7 +111,9 @@ class TestShortLiveApp(TestCase): > self.tester.scapy_execute() > time.sleep(3) >=20 > - out =3D self.tester.scapy_get_result() > + pkts =3D self.tester.load_tcpdump_sniff_packets(inst) > + out =3D str(pkts[0].pktgen.pkt.show) > + self.logger.info('SCAPY Result:\n' + out + '\n\n\n') > if received: > self.verify(('PPP' in out) and 'src=3D%s'% Dut_tx_mac in out= , > "Receive test failed") > else: > diff --git a/tests/TestSuite_vxlan.py b/tests/TestSuite_vxlan.py index > d5a9d77..8de8384 100644 > --- a/tests/TestSuite_vxlan.py > +++ b/tests/TestSuite_vxlan.py > @@ -447,16 +447,14 @@ class TestVxlan(TestCase, IxiaPacketGenerator): > config.create_pcap() >=20 > # remove tempory files > + config.capture_file =3D "/tmp/sniff_%s.pcap" % self.recv_iface > self.tester.send_expect("rm -rf %s" % config.capture_file, "# ") > # save the capture packet into pcap format > self.tester.scapy_background() > - self.tester.scapy_append( > - > 'p=3Dsniff(iface=3D"%s",filter=3D"ether[12:2]!=3D0x88cc",count=3D1,timeou= t=3D5)' % > self.recv_iface) > - self.tester.scapy_append( > - 'wrpcap(\"%s\", p)' % config.capture_file) > - self.tester.scapy_foreground() >=20 > + inst =3D self.tester.tcpdump_sniff_packets(self.recv_iface, > + timeout=3D5) > config.send_pcap(self.tester_iface) > + self.tester.load_tcpdump_sniff_packets(inst) > time.sleep(5) >=20 > # extract the checksum offload from saved pcap file > -- > 2.7.4