fixed missing dependency
[sliver-openvswitch.git] / tests / ovs-ofctl.at
index b1b4c6c..075f2e4 100644 (file)
@@ -10,6 +10,8 @@ tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
+actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
+in_port=0 actions=resubmit:0
 ]])
 
 AT_CHECK([ovs-ofctl parse-flows flows.txt
 ]])
 
 AT_CHECK([ovs-ofctl parse-flows flows.txt
@@ -18,15 +20,72 @@ AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
 [[usable protocols: any
 chosen protocol: OpenFlow10-table_id
 OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
 [[usable protocols: any
 chosen protocol: OpenFlow10-table_id
 OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
-OFPT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
+OFPT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
 OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
 OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
 OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
 OFPT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
 OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
 OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
 OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
 OFPT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
+OFPT_FLOW_MOD: ADD actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[0..63],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[64..127]
+OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0
 ]])
 AT_CLEANUP
 
 ]])
 AT_CLEANUP
 
+AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.2)])
+AT_DATA([flows.txt], [[
+# comment
+tcp,tp_src=123,actions=flood
+in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
+udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
+tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
+udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
+cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
+actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
+actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
+in_port=0 actions=resubmit:0
+]])
+
+AT_CHECK([ovs-ofctl --protocols OpenFlow12 parse-flows flows.txt
+], [0], [stdout])
+AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
+[[usable protocols: any
+chosen protocol: OXM-OpenFlow12
+OFPT_FLOW_MOD (OF1.2): ADD table:255 tcp,tp_src=123 actions=FLOOD
+OFPT_FLOW_MOD (OF1.2): ADD table:255 in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
+OFPT_FLOW_MOD (OF1.2): ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
+OFPT_FLOW_MOD (OF1.2): ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
+OFPT_FLOW_MOD (OF1.2): ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
+OFPT_FLOW_MOD (OF1.2): ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
+OFPT_FLOW_MOD (OF1.2): ADD table:255 actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
+OFPT_FLOW_MOD (OF1.2): ADD table:255 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
+OFPT_FLOW_MOD (OF1.2): ADD table:255 in_port=0 actions=resubmit:0
+]])
+AT_CLEANUP
+
+AT_SETUP([ovs-ofctl parse-flows (With Tunnel-Parameters)])
+AT_DATA([flows.txt], [[
+tun_id=0x1234000056780000/0xffff0000ffff0000,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=0x3,tun_ttl=20,tun_flags=key|csum actions=drop
+]])
+
+AT_CHECK([ovs-ofctl parse-flows flows.txt
+], [1], [usable protocols: none
+], [stderr])
+
+AT_CLEANUP
+
+
+AT_SETUP([ovs-ofctl parse-flows (skb_mark and skb_priority)])
+AT_DATA([flows.txt], [[
+skb_mark=0x12345678,skb_priority=0x12341234,tcp,tp_src=123,actions=flood
+]])
+
+AT_CHECK([ovs-ofctl parse-flows flows.txt
+], [1], [usable protocols: none
+], [stderr])
+
+AT_CLEANUP
+
+
 AT_SETUP([ovs-ofctl parse-flows (NXM)])
 AT_DATA([flows.txt], [[
 # comment
 AT_SETUP([ovs-ofctl parse-flows (NXM)])
 AT_DATA([flows.txt], [[
 # comment
@@ -62,10 +121,10 @@ actions=controller(max_len=123,reason=invalid_ttl,id=555)
 AT_CHECK([ovs-ofctl parse-flows flows.txt
 ], [0], [stdout])
 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
 AT_CHECK([ovs-ofctl parse-flows flows.txt
 ], [0], [stdout])
 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
-[[usable protocols: NXM+table_id
+[[usable protocols: OXM,NXM+table_id
 chosen protocol: NXM+table_id
 NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD
 chosen protocol: NXM+table_id
 NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD
-NXT_FLOW_MOD: ADD table:255 in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
+NXT_FLOW_MOD: ADD table:255 in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
 NXT_FLOW_MOD: ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
 NXT_FLOW_MOD: ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
 NXT_FLOW_MOD: ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
 NXT_FLOW_MOD: ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
 NXT_FLOW_MOD: ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
 NXT_FLOW_MOD: ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
@@ -127,10 +186,10 @@ dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop
 ])
 AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
 ])
 AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
-usable protocols: NXM
+usable protocols: NXM,OXM
 chosen protocol: NXM-table_id
 NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
 chosen protocol: NXM-table_id
 NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
-NXT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
+NXT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
 NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
 NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2
 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
 NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
 NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2
 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
@@ -184,12 +243,12 @@ tun_id=0x1234,cookie=0x5678,actions=flood
 actions=drop
 reg0=123,actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:55->NXM_NX_REG2[0..31],move:NXM_NX_REG0[0..31]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[]
 actions=move:OXM_OF_ETH_DST[]->OXM_OF_ETH_SRC[]
 actions=drop
 reg0=123,actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:55->NXM_NX_REG2[0..31],move:NXM_NX_REG0[0..31]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[]
 actions=move:OXM_OF_ETH_DST[]->OXM_OF_ETH_SRC[]
-actions=autopath(5,NXM_NX_REG0[])
+actions=push:NXM_NX_REG0[0..31],pop:NXM_NX_REG0[]
 vlan_tci=0x1123/0x1fff,actions=drop
 ]])
 vlan_tci=0x1123/0x1fff,actions=drop
 ]])
-AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout])
+AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout], [stderr])
 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
-[[usable protocols: NXM
+[[usable protocols: NXM,OXM
 chosen protocol: NXM-table_id
 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
 chosen protocol: NXM-table_id
 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
@@ -213,7 +272,7 @@ NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
 NXT_FLOW_MOD: ADD <any> actions=drop
 NXT_FLOW_MOD: ADD NXM_NX_REG0(0000007b) actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:0x37->NXM_NX_REG2[],move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[]
 NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[]
 NXT_FLOW_MOD: ADD <any> actions=drop
 NXT_FLOW_MOD: ADD NXM_NX_REG0(0000007b) actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:0x37->NXM_NX_REG2[],move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[]
 NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[]
-NXT_FLOW_MOD: ADD <any> actions=autopath(5,NXM_NX_REG0[])
+NXT_FLOW_MOD: ADD <any> actions=push:NXM_NX_REG0[],pop:NXM_NX_REG0[]
 NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
 ]])
 AT_CLEANUP
 NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
 ]])
 AT_CLEANUP
@@ -370,6 +429,41 @@ NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4)
 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
 NXM_NX_ARP_THA(0002e30f80a4)
 
 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
 NXM_NX_ARP_THA(0002e30f80a4)
 
+# RARP opcode
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003)
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(1111)
+NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0003)
+NXM_OF_ARP_OP(0003)
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003) NXM_OF_ARP_OP(0003)
+
+# RARP source protocol address
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA(ac100014)
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00)
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/ffffffff)
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/00000000)
+NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
+NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000)
+
+# RARP destination protocol address
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA(ac100014)
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/77777777)
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/ffffffff)
+NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/00000000)
+NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
+NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
+
+# RARP source hardware address
+NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_SHA(0002e30f80a4)
+NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
+NXM_NX_ARP_SHA(0002e30f80a4)
+
+# RARP destination hardware address
+NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_THA(0002e30f80a4)
+NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
+NXM_NX_ARP_THA(0002e30f80a4)
+
 # IPv6 source
 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
 # IPv6 source
 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
@@ -472,7 +566,7 @@ NXM_NX_REG0_W(a0e0d050/00000000)
 00011e04(12345678)
 00011f08(12345678/12345678)
 ])
 00011e04(12345678)
 00011f08(12345678/12345678)
 ])
-AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
+AT_CHECK([ovs-ofctl -vPATTERN:'console:%c|%p|%m' --strict parse-nx-match < nx-match.txt], [0], [dnl
 <any>
 
 # in port
 <any>
 
 # in port
@@ -622,6 +716,41 @@ NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4)
 nx_pull_match() returned error OFPBMC_BAD_PREREQ
 nx_pull_match() returned error OFPBMC_BAD_PREREQ
 
 nx_pull_match() returned error OFPBMC_BAD_PREREQ
 nx_pull_match() returned error OFPBMC_BAD_PREREQ
 
+# RARP opcode
+NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_OP(0003)
+nx_pull_match() returned error OFPBMC_BAD_VALUE
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
+nx_pull_match() returned error OFPBMC_DUP_FIELD
+
+# RARP source protocol address
+NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(ac100014)
+NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA_W(c0a81200/ffffff00)
+NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA_W(80a80200/aaaaaa00)
+NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(c0a81234)
+NXM_OF_ETH_TYPE(8035)
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
+
+# RARP destination protocol address
+NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(ac100014)
+NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA_W(c0a81200/ffffff00)
+NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA_W(40201234/77777777)
+NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(c0a81234)
+NXM_OF_ETH_TYPE(8035)
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
+
+# RARP source hardware address
+NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_SHA(0002e30f80a4)
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
+
+# RARP destination hardware address
+NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_THA(0002e30f80a4)
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
+
 # IPv6 source
 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
 nx_pull_match() returned error OFPBMC_BAD_PREREQ
 # IPv6 source
 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
 nx_pull_match() returned error OFPBMC_BAD_PREREQ
@@ -723,62 +852,71 @@ NXM_NX_REG0(12345678)
 NXM_NX_REG0_W(12345678/12345678)
 nx_pull_match() returned error OFPBMC_BAD_FIELD
 nx_pull_match() returned error OFPBMC_BAD_FIELD
 NXM_NX_REG0_W(12345678/12345678)
 nx_pull_match() returned error OFPBMC_BAD_FIELD
 nx_pull_match() returned error OFPBMC_BAD_FIELD
+], [stderr])
+
+# Check that at least the first warning made it.  (It's rate-limited
+# so a variable number could show up, especially under valgrind etc.)
+AT_CHECK([grep 'has 1-bits in value' stderr | sed 1q], [0], [dnl
+nx_match|WARN|NXM/OXM entry NXM_OF_ETH_DST_W(ffffffffffff/010000000000) has 1-bits in value for bits wildcarded by the mask.  (Future versions of OVS may report this as an OpenFlow error.)
 ])
 ])
+
+# Check that there wasn't any other stderr output.
+AT_CHECK([grep -v 'has 1-bits in value' stderr], [1])
 AT_CLEANUP
 
 AT_SETUP([ovs-ofctl parse-ofp10-match])
 AT_KEYWORDS([OF1.0])
 AT_DATA([test-data], [dnl
 AT_CLEANUP
 
 AT_SETUP([ovs-ofctl parse-ofp10-match])
 AT_KEYWORDS([OF1.0])
 AT_DATA([test-data], [dnl
-# in_port=65534
-003820fe fffe 000000000000 000000000000 0000 00 00 0000 00 00 0000 dnl
-00000000 00000000 0000 0000
+# in_port=LOCAL
+003820fe fffe xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # dl_src=00:01:02:03:04:05
 
 # dl_src=00:01:02:03:04:05
-003820fb 0000 000102030405 000000000000 0000 00 00 0000 00 00 0000 dnl
-00000000 00000000 0000 0000
+003820fb xxxx 000102030405 xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # dl_dst=10:20:30:40:50:60
 
 # dl_dst=10:20:30:40:50:60
-003820f7 0000 000000000000 102030405060 0000 00 00 0000 00 00 0000 dnl
-00000000 00000000 0000 0000
+003820f7 xxxx xxxxxxxxxxxx 102030405060 xxxx xx xx xxxx xx xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # dl_vlan=291
 
 # dl_vlan=291
-003820fd 0000 000000000000 000000000000 0123 00 00 0000 00 00 0000 dnl
-00000000 00000000 0000 0000
+003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 xx xx xxxx xx xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # dl_vlan_pcp=5
 
 # dl_vlan_pcp=5
-002820ff 0000 000000000000 000000000000 0000 05 00 0000 00 00 0000 dnl
-00000000 00000000 0000 0000
+002820ff xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx 05 xx xxxx xx xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # dl_vlan=291,dl_vlan_pcp=4
 
 # dl_vlan=291,dl_vlan_pcp=4
-002820fd 0000 000000000000 000000000000 0123 04 00 0000 00 00 0000 dnl
-00000000 00000000 0000 0000
+002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 04 xx xxxx xx xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # vlan_tci=0x0000
 
 # vlan_tci=0x0000
-003820fd 0000 000000000000 000000000000 ffff 00 00 0000 00 00 0000 dnl
-00000000 00000000 0000 0000
+003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff xx xx xxxx xx xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 dnl dl_vlan_pcp doesn't make sense when dl_vlan is "none", so
 dnl OVS ignores it and drops it on output.
 # vlan_tci=0x0000
 #  1: 28 -> 38
 # 20: 05 -> 00
 
 dnl dl_vlan_pcp doesn't make sense when dl_vlan is "none", so
 dnl OVS ignores it and drops it on output.
 # vlan_tci=0x0000
 #  1: 28 -> 38
 # 20: 05 -> 00
-002820fd 0000 000000000000 000000000000 ffff 05 00 0000 00 00 0000 dnl
-00000000 00000000 0000 0000
+002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff 05 xx xxxx xx xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 dnl Invalid VID and PCP discards out-of-range bits:
 # dl_vlan=256,dl_vlan_pcp=7
 # 18: f1 -> 01
 # 20: ff -> 07
 
 dnl Invalid VID and PCP discards out-of-range bits:
 # dl_vlan=256,dl_vlan_pcp=7
 # 18: f1 -> 01
 # 20: ff -> 07
-002820fd 0000 000000000000 000000000000 f100 ff 00 0000 00 00 0000 dnl
-00000000 00000000 0000 0000
+002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx f100 ff xx xxxx xx xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # dl_type=0x1234
 
 # dl_type=0x1234
-003820ef 0000 000000000000 000000000000 0000 00 00 1234 00 00 0000 dnl
-00000000 00000000 0000 0000
+003820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # ip,nw_proto=5
 
 # ip,nw_proto=5
-003820cf 0000 000000000000 000000000000 0000 00 00 0800 00 05 0000 dnl
-00000000 00000000 0000 0000
+003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 05 xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 dnl Ignore nw_proto if not IP or ARP:
 # dl_type=0x1234,nw_proto=5
 
 dnl Ignore nw_proto if not IP or ARP:
 # dl_type=0x1234,nw_proto=5
@@ -787,12 +925,12 @@ dnl Ignore nw_proto if not IP or ARP:
 & ofp_util|INFO|normalization changed ofp_match, details:
 & ofp_util|INFO| pre: dl_type=0x1234,nw_proto=5
 & ofp_util|INFO|post: dl_type=0x1234
 & ofp_util|INFO|normalization changed ofp_match, details:
 & ofp_util|INFO| pre: dl_type=0x1234,nw_proto=5
 & ofp_util|INFO|post: dl_type=0x1234
-003820cf 0000 000000000000 000000000000 0000 00 00 1234 00 05 0000 dnl
-00000000 00000000 0000 0000
+003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx 05 xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # ip,nw_tos=252
 
 # ip,nw_tos=252
-001820ef 0000 000000000000 000000000000 0000 00 00 0800 fc 00 0000 dnl
-00000000 00000000 0000 0000
+001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 fc xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 dnl Ignore nw_tos if not IP:
 # arp,nw_tos=4
 
 dnl Ignore nw_tos if not IP:
 # arp,nw_tos=4
@@ -802,54 +940,54 @@ dnl Ignore nw_tos if not IP:
 & ofp_util|INFO|normalization changed ofp_match, details:
 & ofp_util|INFO| pre: arp,nw_tos=4
 & ofp_util|INFO|post: arp
 & ofp_util|INFO|normalization changed ofp_match, details:
 & ofp_util|INFO| pre: arp,nw_tos=4
 & ofp_util|INFO|post: arp
-001820ef 0000 000000000000 000000000000 0000 00 00 0806 05 00 0000 dnl
-00000000 00000000 0000 0000
+001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 05 xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 dnl Low 2 bits of invalid TOS are forced to 0:
 # ip,nw_tos=48
 # 24: 31 -> 30
 
 dnl Low 2 bits of invalid TOS are forced to 0:
 # ip,nw_tos=48
 # 24: 31 -> 30
-001820ef 0000 000000000000 000000000000 0000 00 00 0800 31 00 0000 dnl
-00000000 00000000 0000 0000
+001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 31 xx xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # arp,arp_op=2
 
 # arp,arp_op=2
-003820cf 0000 000000000000 000000000000 0000 00 00 0806 00 02 0000 dnl
-00000000 00000000 0000 0000
+003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx 02 xxxx dnl
+xxxxxxxx xxxxxxxx xxxx xxxx
 
 # ip,nw_src=192.168.128.85
 
 # ip,nw_src=192.168.128.85
-003800ef 0000 000000000000 000000000000 0000 00 00 0800 00 00 0000 dnl
-c0a88055 00000000 0000 0000
+003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
+c0a88055 xxxxxxxx xxxx xxxx
 
 # ip,nw_src=192.168.128.0/24
 # 31: 55 -> 00
 
 # ip,nw_src=192.168.128.0/24
 # 31: 55 -> 00
-003808ef 0000 000000000000 000000000000 0000 00 00 0800 00 00 0000 dnl
-c0a88055 00000000 0000 0000
+003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
+c0a88055 xxxxxxxx xxxx xxxx
 
 # ip,nw_dst=192.168.128.85
 
 # ip,nw_dst=192.168.128.85
-003020ef 0000 000000000000 000000000000 0000 00 00 0800 00 00 0000 dnl
-00000000 c0a88055 0000 0000
+003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
+xxxxxxxx c0a88055 xxxx xxxx
 
 # ip,nw_dst=192.168.128.0/24
 # 35: 55 -> 00
 
 # ip,nw_dst=192.168.128.0/24
 # 35: 55 -> 00
-003220ef 0000 000000000000 000000000000 0000 00 00 0800 00 00 0000 dnl
-00000000 c0a88055 0000 0000
+003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
+xxxxxxxx c0a88055 xxxx xxxx
 
 
-# arp,nw_src=192.168.128.85
-003800ef 0000 000000000000 000000000000 0000 00 00 0806 00 00 0000 dnl
-c0a88055 00000000 0000 0000
+# arp,arp_spa=192.168.128.85
+003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
+c0a88055 xxxxxxxx xxxx xxxx
 
 
-# arp,nw_src=192.168.128.0/24
+# arp,arp_spa=192.168.128.0/24
 # 31: 55 -> 00
 # 31: 55 -> 00
-003808ef 0000 000000000000 000000000000 0000 00 00 0806 00 00 0000 dnl
-c0a88055 00000000 0000 0000
+003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
+c0a88055 xxxxxxxx xxxx xxxx
 
 
-# arp,nw_dst=192.168.128.85
-003020ef 0000 000000000000 000000000000 0000 00 00 0806 00 00 0000 dnl
-00000000 c0a88055 0000 0000
+# arp,arp_tpa=192.168.128.85
+003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
+xxxxxxxx c0a88055 xxxx xxxx
 
 
-# arp,nw_dst=192.168.128.0/24
+# arp,arp_tpa=192.168.128.0/24
 # 35: 55 -> 00
 # 35: 55 -> 00
-003220ef 0000 000000000000 000000000000 0000 00 00 0806 00 00 0000 dnl
-00000000 c0a88055 0000 0000
+003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
+xxxxxxxx c0a88055 xxxx xxxx
 
 dnl Ignore nw_src if not IP or ARP:
 # dl_type=0x1234,nw_src=192.168.128.0/24
 
 dnl Ignore nw_src if not IP or ARP:
 # dl_type=0x1234,nw_src=192.168.128.0/24
@@ -861,8 +999,8 @@ dnl Ignore nw_src if not IP or ARP:
 & ofp_util|INFO|normalization changed ofp_match, details:
 & ofp_util|INFO| pre: dl_type=0x1234,nw_src=192.168.128.0/24
 & ofp_util|INFO|post: dl_type=0x1234
 & ofp_util|INFO|normalization changed ofp_match, details:
 & ofp_util|INFO| pre: dl_type=0x1234,nw_src=192.168.128.0/24
 & ofp_util|INFO|post: dl_type=0x1234
-003808ef 0000 000000000000 000000000000 0000 00 00 1234 00 00 0000 dnl
-c0a88055 00000000 0000 0000
+003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
+c0a88055 xxxxxxxx xxxx xxxx
 
 dnl Ignore nw_dst if not IP or ARP:
 # dl_type=0x1234,nw_dst=192.168.128.0/24
 
 dnl Ignore nw_dst if not IP or ARP:
 # dl_type=0x1234,nw_dst=192.168.128.0/24
@@ -874,32 +1012,32 @@ dnl Ignore nw_dst if not IP or ARP:
 & ofp_util|INFO|normalization changed ofp_match, details:
 & ofp_util|INFO| pre: dl_type=0x1234,nw_dst=192.168.128.0/24
 & ofp_util|INFO|post: dl_type=0x1234
 & ofp_util|INFO|normalization changed ofp_match, details:
 & ofp_util|INFO| pre: dl_type=0x1234,nw_dst=192.168.128.0/24
 & ofp_util|INFO|post: dl_type=0x1234
-003220ef 0000 000000000000 000000000000 0000 00 00 1234 00 00 0000 dnl
-00000000 c0a88055 0000 0000
+003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
+xxxxxxxx c0a88055 xxxx xxxx
 
 # tcp,tp_src=443
 
 # tcp,tp_src=443
-0038208f 0000 000000000000 000000000000 0000 00 00 0800 00 06 0000 dnl
-00000000 00000000 01bb 0000
+0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl
+xxxxxxxx xxxxxxxx 01bb xxxx
 
 # tcp,tp_dst=443
 
 # tcp,tp_dst=443
-0038204f 0000 000000000000 000000000000 0000 00 00 0800 00 06 0000 dnl
-00000000 00000000 0000 01bb
+0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl
+xxxxxxxx xxxxxxxx xxxx 01bb
 
 # udp,tp_src=443
 
 # udp,tp_src=443
-0038208f 0000 000000000000 000000000000 0000 00 00 0800 00 11 0000 dnl
-00000000 00000000 01bb 0000
+0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl
+xxxxxxxx xxxxxxxx 01bb xxxx
 
 # udp,tp_dst=443
 
 # udp,tp_dst=443
-0038204f 0000 000000000000 000000000000 0000 00 00 0800 00 11 0000 dnl
-00000000 00000000 0000 01bb
+0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl
+xxxxxxxx xxxxxxxx xxxx 01bb
 
 # icmp,icmp_type=5
 
 # icmp,icmp_type=5
-0038208f 0000 000000000000 000000000000 0000 00 00 0800 00 01 0000 dnl
-00000000 00000000 0005 0000
+0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl
+xxxxxxxx xxxxxxxx 0005 xxxx
 
 # icmp,icmp_code=8
 
 # icmp,icmp_code=8
-0038204f 0000 000000000000 000000000000 0000 00 00 0800 00 01 0000 dnl
-00000000 00000000 0000 0008
+0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl
+xxxxxxxx xxxxxxxx xxxx 0008
 
 dnl Ignore tp_src if not TCP or UDP:
 # ip,nw_proto=21,tp_src=443
 
 dnl Ignore tp_src if not TCP or UDP:
 # ip,nw_proto=21,tp_src=443
@@ -909,8 +1047,8 @@ dnl Ignore tp_src if not TCP or UDP:
 & ofp_util|INFO|normalization changed ofp_match, details:
 & ofp_util|INFO| pre: ip,nw_proto=21,tp_src=443
 & ofp_util|INFO|post: ip,nw_proto=21
 & ofp_util|INFO|normalization changed ofp_match, details:
 & ofp_util|INFO| pre: ip,nw_proto=21,tp_src=443
 & ofp_util|INFO|post: ip,nw_proto=21
-0038208f 0000 000000000000 000000000000 0000 00 00 0800 00 15 0000 dnl
-00000000 00000000 01bb 0000
+0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl
+xxxxxxxx xxxxxxxx 01bb xxxx
 
 dnl Ignore tp_dst if not TCP or UDP:
 # ip,nw_proto=21,tp_dst=443
 
 dnl Ignore tp_dst if not TCP or UDP:
 # ip,nw_proto=21,tp_dst=443
@@ -918,8 +1056,8 @@ dnl Ignore tp_dst if not TCP or UDP:
 # normal: 38: 01 -> 00
 # normal: 39: bb -> 00
 dnl The normalization details are suppressed here due to rate-limiting.
 # normal: 38: 01 -> 00
 # normal: 39: bb -> 00
 dnl The normalization details are suppressed here due to rate-limiting.
-0038204f 0000 000000000000 000000000000 0000 00 00 0800 00 15 0000 dnl
-00000000 00000000 0000 01bb
+0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl
+xxxxxxxx xxxxxxxx xxxx 01bb
 
 ])
 sed '/^[[#&]]/d' < test-data > input.txt
 
 ])
 sed '/^[[#&]]/d' < test-data > input.txt
@@ -936,7 +1074,7 @@ AT_CLEANUP
 AT_SETUP([ovs-ofctl parse-ofp11-match])
 AT_KEYWORDS([OF1.1])
 AT_DATA([test-data], [dnl
 AT_SETUP([ovs-ofctl parse-ofp11-match])
 AT_KEYWORDS([OF1.1])
 AT_DATA([test-data], [dnl
-# in_port=65534
+# in_port=LOCAL
 0000 0058 fffffffe 000003fe dnl
 000000000000ffffffffffff 000000000000ffffffffffff dnl
 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
 0000 0058 fffffffe 000003fe dnl
 000000000000ffffffffffff 000000000000ffffffffffff dnl
 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
@@ -1102,13 +1240,13 @@ dnl Try invalid TOS:
 0000 00 00 0800 00 00 00000000ffffffff c0a880005a5a5a5a 0000 0000 dnl
 00000000 00 000000 0000000000000000ffffffffffffffff
 
 0000 00 00 0800 00 00 00000000ffffffff c0a880005a5a5a5a 0000 0000 dnl
 00000000 00 000000 0000000000000000ffffffffffffffff
 
-# arp,nw_src=192.168.128.0/24
+# arp,arp_spa=192.168.128.0/24
 0000 0058 00000000 000003f7 dnl
 000000000000ffffffffffff 000000000000ffffffffffff dnl
 0000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl
 00000000 00 000000 0000000000000000ffffffffffffffff
 
 0000 0058 00000000 000003f7 dnl
 000000000000ffffffffffff 000000000000ffffffffffff dnl
 0000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl
 00000000 00 000000 0000000000000000ffffffffffffffff
 
-# arp,nw_dst=192.168.128.0/24
+# arp,arp_tpa=192.168.128.0/24
 0000 0058 00000000 000003f7 dnl
 000000000000ffffffffffff 000000000000ffffffffffff dnl
 0000 00 00 0806 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl
 0000 0058 00000000 000003f7 dnl
 000000000000ffffffffffff 000000000000ffffffffffff dnl
 0000 00 00 0806 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl
@@ -1473,7 +1611,8 @@ 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)
 ])
 # Invalid field number.
 01020304(1111/2222)
 ])
-AT_CHECK([ovs-ofctl --strict parse-oxm < oxm.txt], [0], [dnl
+AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm < oxm.txt],
+  [0], [dnl
 <any>
 
 # in port
 <any>
 
 # in port
@@ -1667,7 +1806,16 @@ nx_pull_match() returned error OFPBMC_BAD_PREREQ
 
 # Invalid field number.
 nx_pull_match() returned error OFPBMC_BAD_FIELD
 
 # Invalid field number.
 nx_pull_match() returned error OFPBMC_BAD_FIELD
+], [stderr])
+
+# Check that at least the first warning made it.  (It's rate-limited
+# so a variable number could show up, especially under valgrind etc.)
+AT_CHECK([grep 'has 1-bits in value' stderr | sed 1q], [0], [dnl
+nx_match|WARN|NXM/OXM entry OXM_OF_METADATA_W(1234567890abcdef/ffff0000ffff0000) has 1-bits in value for bits wildcarded by the mask.  (Future versions of OVS may report this as an OpenFlow error.)
 ])
 ])
+
+# Check that there wasn't any other stderr output.
+AT_CHECK([grep -v 'has 1-bits in value' stderr], [1])
 AT_CLEANUP
 
 AT_SETUP([ovs-ofctl parse-oxm loose])
 AT_CLEANUP
 
 AT_SETUP([ovs-ofctl parse-oxm loose])
@@ -1786,10 +1934,10 @@ dnl Check that "-F openflow10" rejects a flow_mod with unsupported features,
 dnl such as tunnels and metadata.
 AT_SETUP([ovs-ofctl -F option and NXM features])
 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
 dnl such as tunnels and metadata.
 AT_SETUP([ovs-ofctl -F option and NXM features])
 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
-  [1], [], [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
+  [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10)
 ])
 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop],
 ])
 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop],
-  [1], [], [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
+  [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10)
 ])
 AT_CLEANUP
 
 ])
 AT_CLEANUP
 
@@ -1824,7 +1972,7 @@ dnl can't be represented in OpenFlow 1.0.
 AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
 OVS_VSWITCHD_START
 AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
 AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
 OVS_VSWITCHD_START
 AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
-  [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
+  [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10)
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
@@ -1934,14 +2082,6 @@ AT_CLEANUP
 AT_SETUP([ovs-ofctl diff-flows])
 OVS_VSWITCHD_START
 
 AT_SETUP([ovs-ofctl diff-flows])
 OVS_VSWITCHD_START
 
-# Prints the integers from $1 to $2, increasing by $3 (default 1) on stdout.
-seq () {
-    while test $1 -le $2; do
-        echo $1
-        set `expr $1 + ${3-1}` $2 $3
-    done
-}
-
 # Add tons of flows to br0.
 for i in `seq 0 1023`; do echo "dl_vlan=$i,actions=drop"; done > add-flows.txt
 AT_CHECK([ovs-ofctl add-flows br0 add-flows.txt])
 # Add tons of flows to br0.
 for i in `seq 0 1023`; do echo "dl_vlan=$i,actions=drop"; done > add-flows.txt
 AT_CHECK([ovs-ofctl add-flows br0 add-flows.txt])
@@ -1987,3 +2127,24 @@ AT_CHECK([ovs-ofctl diff-flows flows.txt br0], [2], [dnl
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
+
+AT_SETUP([ovs-ofctl -F and -O interaction])
+AT_CHECK([ovs-ofctl -F oxm -O openflow10], [1], [],
+  [ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow10) supports any of the enabled flow formats (OXM).  (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.)
+])
+AT_CHECK([ovs-ofctl -F oxm -O openflow11], [1], [],
+  [ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow11) supports any of the enabled flow formats (OXM).  (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.)
+])
+AT_CHECK([ovs-ofctl -F oxm -O openflow10,openflow11], [1], [],
+  [ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow10, OpenFlow11) supports any of the enabled flow formats (OXM).  (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.)
+])
+AT_CHECK([ovs-ofctl -F oxm -O openflow10,openflow12], [1], [],
+ [ovs-ofctl: missing command name; use --help for help
+])
+AT_CHECK([ovs-ofctl -F oxm -O openflow12], [1], [],
+  [ovs-ofctl: missing command name; use --help for help
+])
+AT_CHECK([ovs-ofctl -F oxm -O openflow13], [1], [],
+  [ovs-ofctl: missing command name; use --help for help
+])
+AT_CLEANUP