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 18310A0531; Mon, 10 Feb 2020 09:57:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0FDA61BF7A; Mon, 10 Feb 2020 09:57:26 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id BBD911BF7B for ; Mon, 10 Feb 2020 09:57:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Feb 2020 00:57:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,424,1574150400"; d="scan'208";a="221488912" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga007.jf.intel.com with ESMTP; 10 Feb 2020 00:57:22 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 10 Feb 2020 00:57:22 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 10 Feb 2020 00:57:21 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.222]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.141]) with mapi id 14.03.0439.000; Mon, 10 Feb 2020 16:57:20 +0800 From: "Tu, Lijuan" To: "Zeng, XiaoxiaoX" , "dts@dpdk.org" CC: "Zeng, XiaoxiaoX" Thread-Topic: [dts] [PATCH V2] tests/ kni: modify send_packet method Thread-Index: AQHV0PfT4VDgWDRWeEq1c80z/A/2W6gUPj9A Date: Mon, 10 Feb 2020 08:57:19 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBC578D@SHSMSX101.ccr.corp.intel.com> References: <1579679114-23347-1-git-send-email-xiaoxiaox.zeng@intel.com> In-Reply-To: <1579679114-23347-1-git-send-email-xiaoxiaox.zeng@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 V2] tests/ kni: modify send_packet 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Zeng Xiaoxiao > Sent: Wednesday, January 22, 2020 3:45 PM > To: dts@dpdk.org > Cc: Zeng, XiaoxiaoX > Subject: [dts] [PATCH V2] tests/ kni: modify send_packet method >=20 > *.use scapy_append will cause drop packets. >=20 > Signed-off-by: Zeng Xiaoxiao > --- > tests/TestSuite_kni.py | 23 ++++++++++------------- > 1 file changed, 10 insertions(+), 13 deletions(-) >=20 > diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index > f1f85df..f611383 100644 > --- a/tests/TestSuite_kni.py > +++ b/tests/TestSuite_kni.py > @@ -43,6 +43,7 @@ import time > from random import randint > from pktgen import PacketGeneratorHelper from test_case import TestCase > +import packet >=20 > dut_ports =3D [] > port_virtual_interaces =3D [] > @@ -259,6 +260,7 @@ class TestKni(TestCase): > "The linux tool brctl is needed to run this test sui= te") >=20 > self.dut.send_expect("sed -i -e > 's/KNI_KMOD_ETHTOOL=3Dn$/KNI_KMOD_ETHTOOL=3Dy/' > config/common_base", "# ", 30) > + self.dut.send_expect("sed -i -e > + 's/CONFIG_RTE_KNI_KMOD=3Dn$/CONFIG_RTE_KNI_KMOD=3Dy/' > config/common_base", > + "# ", 30) > self.dut.build_install_dpdk(self.target) >=20 > out =3D self.dut.build_dpdk_apps("./examples/kni/") > @@ -707,20 +709,15 @@ class TestKni(TestCase): > tx_mac =3D self.tester.get_mac(tx_port) > tx_interface =3D self.tester.get_interface(tx_port) >=20 > - self.tester.scapy_append('dstmac =3D "%s"' % rx_mac) > - self.tester.scapy_append('srcmac =3D "%s"' % tx_mac) > + scapy_str =3D ['Ether(src =3D "%s",dst=3D"%s")/IP()/UDP()/("= X"*28)' % > (tx_mac, rx_mac), > + 'Ether(src =3D "%s",dst=3D"%s")/IP()/TCP()/("X"= *28)' % (tx_mac, > rx_mac), > + 'Ether(src =3D "%s",dst=3D"%s")/IP()/ICMP()/("X= "*28)' % (tx_mac, > rx_mac), > + 'Ether(src =3D "%s",dst=3D"%s")/IP()/("X"*38)' = % (tx_mac, rx_mac), > + 'Ether(src =3D "%s",dst=3D"%s")/("X"*46)' % > + (tx_mac, rx_mac), ] >=20 > - self.tester.scapy_append( > - 'sendp([Ether(src =3D > srcmac,dst=3Ddstmac)/IP()/UDP()/("X"*28)],iface=3D"%s",count=3D200)' % > tx_interface) > - self.tester.scapy_append( > - 'sendp([Ether(src =3D > srcmac,dst=3Ddstmac)/IP()/TCP()/("X"*28)],iface=3D"%s",count=3D200)' % > tx_interface) > - self.tester.scapy_append( > - 'sendp([Ether(src =3D > srcmac,dst=3Ddstmac)/IP()/ICMP()/("X"*28)],iface=3D"%s",count=3D200)' % > tx_interface) > - self.tester.scapy_append( > - 'sendp([Ether(src =3D > srcmac,dst=3Ddstmac)/IP()/("X"*38)],iface=3D"%s",count=3D200)' % tx_inter= face) > - self.tester.scapy_append( > - 'sendp([Ether(src =3D > srcmac,dst=3Ddstmac)/("X"*46)],iface=3D"%s",count=3D200)' % tx_interface) > - self.tester.scapy_execute() > + pkt =3D packet.Packet() > + pkt.update_pkt(scapy_str) > + pkt.send_pkt(self.tester, tx_port=3Dtx_interface, count=3D20= 0) >=20 > out =3D self.dut.send_expect("ifconfig %s" % virtual_interfa= ce, "# ") > m =3D re.search(rx_match, out) > -- > 1.8.3.1