testutils: add simple_{tcp,udp,icmp}v6_packet()
These are simplified and IPv6-ified versions of the existing functions.
Also added IPv6 packets to the OF 1.3 ethertype tests.
diff --git a/tests-1.3/match.py b/tests-1.3/match.py
index 8a46118..c81fc38 100644
--- a/tests-1.3/match.py
+++ b/tests-1.3/match.py
@@ -301,7 +301,30 @@
nonmatching = {
"arp": simple_arp_packet(),
"llc": llc_pkt,
- # TODO ipv6
+ "ipv6/tcp": simple_tcpv6_packet(),
+ }
+
+ self.verify_match(match, matching, nonmatching)
+
+class EthTypeIPv6(MatchTest):
+ """
+ Match on ethertype (IPv6)
+ """
+ def runTest(self):
+ match = ofp.match([
+ ofp.oxm.eth_type(0x86dd)
+ ])
+
+ matching = {
+ "ipv6/tcp": simple_tcpv6_packet(),
+ "ipv6/udp": simple_udpv6_packet(),
+ "ipv6/icmp": simple_icmpv6_packet(),
+ "vlan tagged": simple_tcpv6_packet(vlan_vid=2, vlan_pcp=3),
+ }
+
+ nonmatching = {
+ "ipv4/tcp": simple_tcp_packet(),
+ "arp": simple_arp_packet(),
}
self.verify_match(match, matching, nonmatching)
@@ -322,6 +345,7 @@
nonmatching = {
"ipv4/tcp": simple_tcp_packet(),
+ "ipv6/tcp": simple_tcpv6_packet(),
}
self.verify_match(match, matching, nonmatching)
@@ -352,6 +376,7 @@
nonmatching = {
"ipv4/tcp": simple_tcp_packet(),
+ "ipv6/tcp": simple_tcpv6_packet(),
"llc/snap": snap_pkt,
}