From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C6B2827D for ; Tue, 11 Dec 2018 06:29:54 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2018 21:29:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,341,1539673200"; d="scan'208";a="117755887" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 10 Dec 2018 21:29:53 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 21:29:52 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 21:29:52 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.182]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.222]) with mapi id 14.03.0415.000; Tue, 11 Dec 2018 13:29:50 +0800 From: "Zhu, WenhuiX" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" , "Wang, FengqinX" Thread-Topic: [dts] [PATCH V2] Use tcpdump_sniff_packets instead of sniff method Thread-Index: AQHUkPKHxvQbxUIuwUyfpHZIansRfaV5Afyw Date: Tue, 11 Dec 2018 05:29:49 +0000 Message-ID: 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: 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 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 05:29:55 -0000 -----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 The sniff method may not work well when add filter ether arguments, so use = tcpdump_sniff_packets instead of it. Signed-off-by: lihong Test-by: Zhu, WenhuiX --- tests/TestSuite_short_live.py | 9 ++++----- tests/TestSuite_vxlan.py | 8 +++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.py = 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, count)) - 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,=20 + 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 d5a9= d77..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,timeout=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,=20 + 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