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 F1787A046B for ; Wed, 21 Aug 2019 05:29:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B107C1BED1; Wed, 21 Aug 2019 05:29:39 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 99FB21BECB for ; Wed, 21 Aug 2019 05:29:37 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Aug 2019 20:29:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,410,1559545200"; d="scan'208";a="329896941" Received: from dpdk-xinfengx-dut242.sh.intel.com ([10.67.116.235]) by orsmga004.jf.intel.com with ESMTP; 20 Aug 2019 20:29:35 -0700 From: Xinfeng Zhao To: dts@dpdk.org Cc: Xinfeng Zhao Date: Wed, 21 Aug 2019 03:15:38 +0800 Message-Id: <1566328538-190992-1-git-send-email-xinfengx.zhao@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH] tests: fix the issue of using scapy to send packet 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" failed to send packet using the method, because there should be delayed a few seconds bettwen sending packet and exiting scapy, and now instead it with dts scapy method Signed-off-by: Xinfeng Zhao --- tests/TestSuite_vlan_ethertype_config.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/TestSuite_vlan_ethertype_config.py b/tests/TestSuite_vlan_ethertype_config.py index 1cb1083..727067f 100644 --- a/tests/TestSuite_vlan_ethertype_config.py +++ b/tests/TestSuite_vlan_ethertype_config.py @@ -46,7 +46,6 @@ from pmd_output import PmdOutput from scapy.utils import struct, socket, wrpcap, rdpcap from scapy.layers.inet import Ether, IP, TCP, UDP, ICMP from scapy.layers.l2 import Dot1Q, ARP, GRE -from scapy.sendrecv import sendp from settings import DPDK_RXMODE_SETTING from settings import load_global_setting @@ -145,11 +144,10 @@ class TestVlanEthertypeConfig(TestCase): out = self.tester.send_expect("hexdump -ve '%s' '%s' |sed 's/8100000181000002/%s/' |xxd -r -p > '%s'" % ( fmt, self.tpid_ori_file, replace, self.tpid_new_file), "# ") - self.tester.send_expect("scapy", ">>> ") - self.tester.send_expect( - "pkt=rdpcap('%s')" % self.tpid_new_file, ">>> ") - self.tester.send_expect("sendp(pkt, iface='%s')" % self.txItf, ">>> ") - self.tester.send_expect("quit()", "# ") + self.tester.scapy_foreground() + self.tester.scapy_append("pkt=rdpcap('%s')" % self.tpid_new_file) + self.tester.scapy_append("sendp(pkt, iface='%s')" % self.txItf) + self.tester.scapy_execute() def check_vlan_packets(self, vlan, tpid, rxItf, result=True): -- 2.17.1