test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] tests mac_filter: use scapy to send packets
@ 2016-12-02  2:45 Jianbo Liu
  2016-12-02  3:27 ` Liu, Yong
  0 siblings, 1 reply; 7+ messages in thread
From: Jianbo Liu @ 2016-12-02  2:45 UTC (permalink / raw)
  To: dts; +Cc: Jianbo Liu

Signed-off-by: Jianbo Liu <jianbo.liu@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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-12-02  6:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-02  2:45 [dts] [PATCH] tests mac_filter: use scapy to send packets Jianbo Liu
2016-12-02  3:27 ` Liu, Yong
2016-12-02  3:45   ` Jianbo Liu
2016-12-02  5:44     ` Liu, Yong
2016-12-02  6:06       ` Jianbo Liu
2016-12-02  6:13         ` Liu, Yong
2016-12-02  6:32           ` Jianbo Liu

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).