Test packet in and packet out with a few different kinds of packets:
TCP, raw Ethernet with LLDP type, and a packet that's smaller than
the Ethernet minimum (60 bytes) to make sure the switch pads it
rather than dropping it!
diff --git a/tests/testutils.py b/tests/testutils.py
index c7721fd..c6252bc 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -158,6 +158,16 @@
return pkt
+def simple_eth_packet(pktlen=60,
+ dl_dst='00:01:02:03:04:05',
+ dl_src='01:80:c2:00:00:00',
+ dl_type=0x88cc):
+ pkt = scapy.Ether(dst=dl_dst, src=dl_src, type=dl_type)
+
+ pkt = pkt/("0" * (pktlen - len(pkt)))
+
+ return pkt
+
def do_barrier(ctrl):
b = message.barrier_request()
ctrl.transact(b)