bfd: Clarify the BFD diagnostic.
[cascardo/ovs.git] / tests / ovs-ofctl.at
index 6e6461b..1f8261c 100644 (file)
@@ -1890,7 +1890,7 @@ OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_
 # Invalid field number.
 01020304(1111/2222)
 ])
-AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm < oxm.txt],
+AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow12 < oxm.txt],
   [0], [dnl
 <any>
 
@@ -2123,15 +2123,39 @@ AT_DATA([oxm.txt], [dnl
 OXM_OF_IN_PORT(00000001), 01020304(1111/2222), OXM_OF_ETH_TYPE(0800)
 ])
 
-AT_CHECK([ovs-ofctl --strict parse-oxm < oxm.txt], [0], [dnl
+AT_CHECK([ovs-ofctl --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl
 nx_pull_match() returned error OFPBMC_BAD_FIELD
 ])
 
-AT_CHECK([ovs-ofctl parse-oxm < oxm.txt], [0], [dnl
+AT_CHECK([ovs-ofctl parse-oxm OpenFlow12 < oxm.txt], [0], [dnl
 OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800)
 ])
 AT_CLEANUP
 
+AT_SETUP([check TCP flags expression in OXM and NXM])
+# NXM/OXM input for matching on TCP flags.
+tcp_flags='OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)'
+
+# Check that marshaling into NXM gives all NXM headers.
+AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-nxm], [0],
+  [NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff)
+])
+
+# Check that marshaling in OXM for OF1.2 through OF1.4 gives OXM
+# headers except for TCP flags, which didn't have an OXM definition until
+# OF1.5.
+for version in OpenFlow12 OpenFlow13 OpenFlow14; do
+    AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm $version], [0],
+      [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff)
+])
+done
+
+# OpenFlow 1.5 added an OXM header for TCP flags:
+AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow15], [0],
+  [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)
+])
+AT_CLEANUP
+
 dnl Check all of the patterns mentioned in the "VLAN Matching" section
 dnl in the DESIGN file at top level.
 AT_SETUP([ovs-ofctl check-vlan])
@@ -2485,7 +2509,7 @@ AT_CHECK([ovs-ofctl add-flow br0 "tcp,tcp_flags=+ack-ack,action="], [1], [],
   [ovs-ofctl: ack: Each TCP flag can be specified only once
 ])
 
-AT_CHECK([ovs-appctl dpif/show | tail -n +5], [0], [dnl
+AT_CHECK([ovs-appctl dpif/show | tail -n +4], [0], [dnl
                p1 1/1: (dummy)
                p2 2/2: (dummy)
 ])