[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dpdk-dts
Subject:    Re: [dts] [PATCH] tests: fix the issue of using scapy to send packet
From:       "Tu, Lijuan" <lijuan.tu () intel ! com>
Date:       2019-08-30 3:26:35
Message-ID: 8CE3E05A3F976642AAB0F4675D0AD20E0BB078F6 () SHSMSX101 ! ccr ! corp ! intel ! com
[Download RAW message or body]

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xinfeng Zhao
> Sent: Wednesday, August 21, 2019 3:16 AM
> To: dts@dpdk.org
> Cc: Zhao, XinfengX <xinfengx.zhao@intel.com>
> Subject: [dts] [PATCH] tests: fix the issue of using scapy to send packet
> 
> 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic