From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7475F58C8 for ; Fri, 2 Dec 2016 04:27:18 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP; 01 Dec 2016 19:27:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,284,1477983600"; d="scan'208";a="38126807" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 01 Dec 2016 19:27:18 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 1 Dec 2016 19:27:17 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 1 Dec 2016 19:27:17 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.96]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.239]) with mapi id 14.03.0248.002; Fri, 2 Dec 2016 11:27:15 +0800 From: "Liu, Yong" To: Jianbo Liu , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] tests mac_filter: use scapy to send packets Thread-Index: AQHSTEZIcF01Uk30gEKAsLvjSwPh9KDz/hbg Date: Fri, 2 Dec 2016 03:27:15 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E6033532C@SHSMSX103.ccr.corp.intel.com> References: <1480646757-13829-1-git-send-email-jianbo.liu@linaro.org> In-Reply-To: <1480646757-13829-1-git-send-email-jianbo.liu@linaro.org> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTcwMmE0NDEtNTUwYi00MDRkLWFhZTQtNmE2NWNmMmY3MTFhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InNxRXpDOXhmUG9Rd0lUUXczUnFvbzJcL0lMc2NBUmltR05xMmNIeFdcLzEyST0ifQ== x-ctpclassification: CTP_IC 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 mac_filter: use scapy to send packets 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, 02 Dec 2016 03:27:20 -0000 Hi Jianbo, Packet module is one abstract layer based on scapy. We abstracted this laye= r for monitoring scapy process and integrating sniff/configuration function= .=20 It should work the same as scapy command. I'm interesting in why your inten= ded to use scapy replace of Packet module. Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Jianbo Liu > Sent: Friday, December 02, 2016 10:46 AM > To: dts@dpdk.org > Cc: Jianbo Liu > Subject: [dts] [PATCH] tests mac_filter: use scapy to send packets >=20 > Signed-off-by: Jianbo Liu > --- > tests/TestSuite_mac_filter.py | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) >=20 > diff --git a/tests/TestSuite_mac_filter.py b/tests/TestSuite_mac_filter.p= y > index 1c58b87..a06b812 100644 > --- a/tests/TestSuite_mac_filter.py > +++ b/tests/TestSuite_mac_filter.py > @@ -86,9 +86,10 @@ class TestWhitelist(TestCase): > Send 1 packet to portid. > """ > itf =3D > self.tester.get_interface(self.tester.get_local_port(portid)) > - pkt =3D Packet(pkt_type=3D'UDP') > - pkt.config_layer('ether', {'src': '52:00:00:00:00:00', 'dst': > destMac}) > - pkt.send_pkt(tx_port=3Ditf) > + pkt =3D 'Ether(dst=3D"%s", > src=3D"52:00:00:00:00:00")/IP()/UDP()/("X"*46)' % destMac > + self.tester.send_expect("scapy", ">>> ") > + self.tester.scapy_append('sendp([%s], iface=3D"%s")' % (pkt, itf= )) > + self.tester.scapy_execute() >=20 > def test_add_remove_mac_address(self): > """ > -- > 1.9.1