test suite reviews and discussions
 help / color / mirror / Atom feed
From: Xinfeng Zhao <xinfengx.zhao@intel.com>
To: dts@dpdk.org
Cc: Xinfeng Zhao <xinfengx.zhao@intel.com>
Subject: [dts] [PATCH] tests: fix the issue of using scapy to send packet
Date: Wed, 21 Aug 2019 03:15:38 +0800	[thread overview]
Message-ID: <1566328538-190992-1-git-send-email-xinfengx.zhao@intel.com> (raw)

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 <xinfengx.zhao@intel.com>
---
 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


             reply	other threads:[~2019-08-21  3:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 19:15 Xinfeng Zhao [this message]
2019-08-30  3:26 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1566328538-190992-1-git-send-email-xinfengx.zhao@intel.com \
    --to=xinfengx.zhao@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).