[dts] [PATCH] tests mac_filter: use scapy to send packets
Liu, Yong
yong.liu at intel.com
Fri Dec 2 04:27:15 CET 2016
Hi Jianbo,
Packet module is one abstract layer based on scapy. We abstracted this layer for monitoring scapy process and integrating sniff/configuration function.
It should work the same as scapy command. I'm interesting in why your intended to use scapy replace of Packet module.
Thanks,
Marvin
> -----Original Message-----
> From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of Jianbo Liu
> Sent: Friday, December 02, 2016 10:46 AM
> To: dts at dpdk.org
> Cc: Jianbo Liu
> Subject: [dts] [PATCH] tests mac_filter: use scapy to send packets
>
> Signed-off-by: Jianbo Liu <jianbo.liu at linaro.org>
> ---
> tests/TestSuite_mac_filter.py | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tests/TestSuite_mac_filter.py b/tests/TestSuite_mac_filter.py
> index 1c58b87..a06b812 100644
> --- a/tests/TestSuite_mac_filter.py
> +++ b/tests/TestSuite_mac_filter.py
> @@ -86,9 +86,10 @@ class TestWhitelist(TestCase):
> Send 1 packet to portid.
> """
> itf =
> self.tester.get_interface(self.tester.get_local_port(portid))
> - pkt = Packet(pkt_type='UDP')
> - pkt.config_layer('ether', {'src': '52:00:00:00:00:00', 'dst':
> destMac})
> - pkt.send_pkt(tx_port=itf)
> + pkt = 'Ether(dst="%s",
> src="52:00:00:00:00:00")/IP()/UDP()/("X"*46)' % destMac
> + self.tester.send_expect("scapy", ">>> ")
> + self.tester.scapy_append('sendp([%s], iface="%s")' % (pkt, itf))
> + self.tester.scapy_execute()
>
> def test_add_remove_mac_address(self):
> """
> --
> 1.9.1
More information about the dts
mailing list