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 4F60AA0525; Wed, 22 Jan 2020 08:44:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 040922B8B; Wed, 22 Jan 2020 08:44:37 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A69DD2A62 for ; Wed, 22 Jan 2020 08:44:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 23:44:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,348,1574150400"; d="scan'208";a="259370638" Received: from unknown (HELO dpdk-xiaoqimai-tester.sh.intel.com) ([10.239.250.12]) by fmsmga002.fm.intel.com with ESMTP; 21 Jan 2020 23:44:32 -0800 From: Zeng Xiaoxiao To: dts@dpdk.org Cc: Zeng Xiaoxiao Date: Wed, 22 Jan 2020 15:45:14 +0800 Message-Id: <1579679114-23347-1-git-send-email-xiaoxiaox.zeng@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [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" *.use scapy_append will cause drop packets. Signed-off-by: Zeng Xiaoxiao --- tests/TestSuite_kni.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) 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 dut_ports = [] port_virtual_interaces = [] @@ -259,6 +260,7 @@ class TestKni(TestCase): "The linux tool brctl is needed to run this test suite") self.dut.send_expect("sed -i -e 's/KNI_KMOD_ETHTOOL=n$/KNI_KMOD_ETHTOOL=y/' config/common_base", "# ", 30) + self.dut.send_expect("sed -i -e 's/CONFIG_RTE_KNI_KMOD=n$/CONFIG_RTE_KNI_KMOD=y/' config/common_base", "# ", 30) self.dut.build_install_dpdk(self.target) out = self.dut.build_dpdk_apps("./examples/kni/") @@ -707,20 +709,15 @@ class TestKni(TestCase): tx_mac = self.tester.get_mac(tx_port) tx_interface = self.tester.get_interface(tx_port) - self.tester.scapy_append('dstmac = "%s"' % rx_mac) - self.tester.scapy_append('srcmac = "%s"' % tx_mac) + scapy_str = ['Ether(src = "%s",dst="%s")/IP()/UDP()/("X"*28)' % (tx_mac, rx_mac), + 'Ether(src = "%s",dst="%s")/IP()/TCP()/("X"*28)' % (tx_mac, rx_mac), + 'Ether(src = "%s",dst="%s")/IP()/ICMP()/("X"*28)' % (tx_mac, rx_mac), + 'Ether(src = "%s",dst="%s")/IP()/("X"*38)' % (tx_mac, rx_mac), + 'Ether(src = "%s",dst="%s")/("X"*46)' % (tx_mac, rx_mac), ] - self.tester.scapy_append( - 'sendp([Ether(src = srcmac,dst=dstmac)/IP()/UDP()/("X"*28)],iface="%s",count=200)' % tx_interface) - self.tester.scapy_append( - 'sendp([Ether(src = srcmac,dst=dstmac)/IP()/TCP()/("X"*28)],iface="%s",count=200)' % tx_interface) - self.tester.scapy_append( - 'sendp([Ether(src = srcmac,dst=dstmac)/IP()/ICMP()/("X"*28)],iface="%s",count=200)' % tx_interface) - self.tester.scapy_append( - 'sendp([Ether(src = srcmac,dst=dstmac)/IP()/("X"*38)],iface="%s",count=200)' % tx_interface) - self.tester.scapy_append( - 'sendp([Ether(src = srcmac,dst=dstmac)/("X"*46)],iface="%s",count=200)' % tx_interface) - self.tester.scapy_execute() + pkt = packet.Packet() + pkt.update_pkt(scapy_str) + pkt.send_pkt(self.tester, tx_port=tx_interface, count=200) out = self.dut.send_expect("ifconfig %s" % virtual_interface, "# ") m = re.search(rx_match, out) -- 1.8.3.1