]> git.proxmox.com Git - mirror_ovs.git/blobdiff - tests/ofproto.at
conntrack: Rename "master" connection to "parent" connection.
[mirror_ovs.git] / tests / ofproto.at
index 1b0ba94fd8376d3305d52768a7ee7c61ba1bc5b6..f5667362573c90484529b1f01cf530b0653a2d85 100644 (file)
@@ -39,8 +39,8 @@ n_tables:254, n_buffers:0
 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
 actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
  LOCAL(br0): addr:aa:55:aa:55:00:00
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
      speed: 0 Mbps now, 0 Mbps max
 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
 ])
@@ -61,16 +61,16 @@ n_tables:254, n_buffers:0
 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
 actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
  1(p1): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
      speed: 0 Mbps now, 0 Mbps max
  99(p2): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
      speed: 0 Mbps now, 0 Mbps max
  LOCAL(br0): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
      speed: 0 Mbps now, 0 Mbps max
 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
 ])
@@ -125,8 +125,8 @@ AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout])
 AT_CHECK([strip_xids < stdout], [0], [dnl
 OFPST_PORT_DESC reply:
  LOCAL(br0): addr:aa:55:aa:55:00:00
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
      speed: 0 Mbps now, 0 Mbps max
 ])
 OVS_VSWITCHD_STOP
@@ -140,8 +140,8 @@ AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0], [0], [stdout])
 AT_CHECK([strip_xids < stdout], [0], [dnl
 OFPST_PORT_DESC reply (OF1.2):
  LOCAL(br0): addr:aa:55:aa:55:00:00
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max
 ])
 OVS_VSWITCHD_STOP
@@ -154,62 +154,28 @@ AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0],
 AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl
 OFPST_PORT_DESC reply (OF1.5):
  1(p1): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max
  2(p2): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max
  3(p3): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max
  LOCAL(br0): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max
 ])
 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2], [0], [stdout])
 AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl
 OFPST_PORT_DESC reply (OF1.5):
  2(p2): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
-     speed: 0 Mbps now, 0 Mbps max
-])
-OVS_VSWITCHD_STOP
-AT_CLEANUP
-
-AT_SETUP([ofproto - port-desc stats (OpenFlow 1.6)])
-OVS_VSWITCHD_START
-add_of_ports br0 1 2 3
-AT_CHECK([ovs-ofctl -F OXM-OpenFlow16 -O OpenFlow16 -vwarn dump-ports-desc br0], [0], [stdout])
-AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl
-OFPST_PORT_DESC reply (OF1.6):
- 1(p1): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
-     speed: 0 Mbps now, 0 Mbps max
- 2(p2): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
-     speed: 0 Mbps now, 0 Mbps max
- 3(p3): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
-     speed: 0 Mbps now, 0 Mbps max
- LOCAL(br0): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
-     speed: 0 Mbps now, 0 Mbps max
-])
-AT_CHECK([ovs-ofctl -F OXM-OpenFlow16 -O OpenFlow16 -vwarn dump-ports-desc br0 2], [0], [stdout])
-AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl
-OFPST_PORT_DESC reply (OF1.6):
- 2(p2): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max
 ])
 OVS_VSWITCHD_STOP
@@ -357,19 +323,41 @@ AT_CLEANUP
 dnl This is really bare-bones.
 dnl It at least checks request and reply serialization and deserialization.
 dnl Actions definition listed in both supported formats (w/ actions=)
-AT_SETUP([ofproto - no group support (OpenFlow 1.0)])
+AT_SETUP([ofproto - del group (OpenFlow 1.0 extension)])
 OVS_VSWITCHD_START
 AT_DATA([groups.txt], [dnl
-group_id=1234,type=all,bucket=output:10
-group_id=1235,type=all,bucket=actions=output:10
+group_id=1233,type=select,selection_method=hash,bucket=output:10,bucket=output:11
+group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11
+group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
+group_id=1236,type=select,selection_method=dp_hash,bucket=output:10,bucket=output:11
 ])
-AT_DATA([stderr], [dnl
-ovs-ofctl: none of the usable flow formats (OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10,NXM)
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0 1234], [0], [stdout])
+AT_CHECK([strip_xids < stdout], [0], [dnl
+NXST_GROUP_DESC reply:
+ group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
+])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0 group_id=1234])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0], [0], [stdout])
+AT_CHECK([strip_xids < stdout | sort], [0], [dnl
+ group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
+ group_id=1235,type=all,bucket=bucket_id:2,actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
+ group_id=1236,type=select,selection_method=dp_hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
+NXST_GROUP_DESC reply:
+])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0 group_id=1234])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0], [0], [stdout])
+AT_CHECK([strip_xids < stdout | sort], [0], [dnl
+ group_id=1233,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
+ group_id=1235,type=all,bucket=bucket_id:2,actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
+ group_id=1236,type=select,selection_method=dp_hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
+NXST_GROUP_DESC reply:
+])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0], [0])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0], [0], [stdout])
+AT_CHECK([strip_xids < stdout], [0], [dnl
+NXST_GROUP_DESC reply:
 ])
-AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt], [1], ,[stderr])
-AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn mod-group br0 'group_id=1234,type=all,bucket=output:10'], [1], ,[stderr])
-AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0], [1], ,[stderr])
-AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0 ], [1], ,[stderr])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
@@ -656,6 +644,20 @@ AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,comman
 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [],
   [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
 ])
+
+# Verify insert-buckets command to insert bucket with weight value for select group.
+AT_CHECK([ovs-ofctl -O OpenFlow15 --strict del-groups br0 group_id=1234])
+AT_DATA([groups.txt], [dnl
+group_id=1234,type=select,selection_method=hash,bucket=bucket_id=1,weight:100,output:11
+])
+AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
+AT_CHECK([ovs-ofctl -O OpenFlow15 insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id=2,weight=100,actions=output:11])
+AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
+AT_CHECK([strip_xids < stdout], [0], [dnl
+OFPST_GROUP_DESC reply (OF1.5):
+ group_id=1234,type=select,selection_method=hash,bucket=bucket_id:1,weight:100,actions=output:11,bucket=bucket_id:2,weight:100,actions=output:11
+])
+
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
@@ -711,7 +713,7 @@ OFPT_GROUP_MOD (OF1.5):
 ])
 # Negative test.
 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [],
-  [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
+  [ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM,OXM-OpenFlow15) is among the allowed flow formats (OpenFlow11)
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
@@ -1018,7 +1020,7 @@ Error OFPBFC_MSG_FAILED for: OFPT_BUNDLE_CONTROL (OF1.5):
 ])
 # Negative test.
 AT_CHECK([ovs-ofctl --bundle -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [],
-  [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
+  [ovs-ofctl: none of the usable flow formats (OXM-OpenFlow15) is among the allowed flow formats (OXM-OpenFlow14)
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
@@ -1075,20 +1077,33 @@ AT_CLEANUP
 
 dnl This is really bare-bones.
 dnl It at least checks request and reply serialization and deserialization.
-AT_SETUP([ofproto - group description])
+AT_SETUP([ofproto - group features (OpenFlow 1.0 extension)])
 OVS_VSWITCHD_START
-AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
-AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-group-features br0], [0], [stdout])
 AT_CHECK([strip_xids < stdout], [0], [dnl
-OFPST_GROUP_DESC reply (OF1.1):
- group_id=1234,type=all,bucket=actions=output:10
+NXST_GROUP_FEATURES reply:
+ Group table:
+    Types:  0xf
+    Capabilities:  0x7
+    all group:
+       max_groups=0xffffff00
+       actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
+    select group:
+       max_groups=0xffffff00
+       actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
+    indirect group:
+       max_groups=0xffffff00
+       actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
+    fast failover group:
+       max_groups=0xffffff00
+       actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
 dnl This is really bare-bones.
 dnl It at least checks request and reply serialization and deserialization.
-AT_SETUP([ofproto - group features])
+AT_SETUP([ofproto - group features (OpenFlow 1.2)])
 OVS_VSWITCHD_START
 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
 AT_CHECK([strip_xids < stdout], [0], [dnl
@@ -1112,6 +1127,30 @@ OFPST_GROUP_FEATURES reply (OF1.2):
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
+dnl This is really bare-bones.
+dnl It at least checks request and reply serialization and deserialization.
+AT_SETUP([ofproto - group stats (OpenFlow 1.0 extension)])
+OVS_VSWITCHD_START
+AT_DATA([groups.txt], [dnl
+group_id=1234,type=all,bucket=output:10
+group_id=1235,type=all,bucket=output:10
+])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-flow br0 'tcp actions=group:1234'])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
+AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
+ group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
+NXST_GROUP reply:
+])
+AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-group-stats br0], [0], [stdout])
+AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
+ group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
+ group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
+NXST_GROUP reply:
+])
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
 dnl This is really bare-bones.
 dnl It at least checks request and reply serialization and deserialization.
 AT_SETUP([ofproto - group stats (OpenFlow 1.1)])
@@ -1184,6 +1223,22 @@ OFPST_GROUP reply (OF1.5):
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
+dnl This is used to find that the bucket counter is not updated.
+AT_SETUP([ofproto - group stats after insert a new bucket (OpenFlow 1.5)])
+OVS_VSWITCHD_START
+AT_DATA([groups.txt], [dnl
+group_id=1234,type=select,selection_method=hash bucket=bucket_id=1,weight:100,actions=output:10
+])
+AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
+AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 'group_id=1234, command_bucket_id=last, bucket=bucket_id=2,weight:100,actions=output:10'])
+AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
+AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
+ group_id=1234,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0,bucket1:packet_count=0,byte_count=0
+OFPST_GROUP reply (OF1.5):
+])
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
 dnl This found a use-after-free error in bridge destruction in the
 dnl presence of groups.
 AT_SETUP([ofproto - group add then bridge delete (OpenFlow 1.3)])
@@ -1206,16 +1261,17 @@ OVS_VSWITCHD_START
 for command_config_state in \
     'up 0 0' \
     'noflood NO_FLOOD 0' \
-    'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
-    'flood PORT_DOWN LINK_DOWN' \
-    'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
-    'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
-    'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
-    'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
-    'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
+    'flood 0 0' \
+    'no-receive NO_RECV 0' \
+    'no-forward NO_RECV,NO_FWD 0' \
+    'no-packet-in NO_RECV,NO_FWD,NO_PACKET_IN 0' \
+    'forward NO_RECV,NO_PACKET_IN 0' \
+    'packet-in NO_RECV 0' \
     'up NO_RECV 0' \
-    'receive 0 0'
+    'receive 0 0' \
+    'down PORT_DOWN LINK_DOWN'
 do
+    printf '\n--- %s --- \n\n' "$command_config_state"
     set $command_config_state
     command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
     AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
@@ -1239,15 +1295,16 @@ AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
 OVS_VSWITCHD_START
 for command_config_state in \
     'up 0 LIVE' \
-    'down PORT_DOWN LINK_DOWN' \
-    'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
-    'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
-    'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
-    'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
-    'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
+    'no-receive NO_RECV LIVE' \
+    'no-forward NO_RECV,NO_FWD LIVE' \
+    'no-packet-in NO_RECV,NO_FWD,NO_PACKET_IN LIVE' \
+    'forward NO_RECV,NO_PACKET_IN LIVE' \
+    'packet-in NO_RECV LIVE' \
     'up NO_RECV LIVE' \
-    'receive 0 LIVE'
+    'receive 0 LIVE' \
+    'down PORT_DOWN LINK_DOWN'
 do
+    printf '\n--- %s --- \n\n' "$command_config_state"
     set $command_config_state
     command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
     AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
@@ -1270,15 +1327,16 @@ AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
 OVS_VSWITCHD_START
 for command_config_state in \
     'up 0 LIVE' \
-    'down PORT_DOWN LINK_DOWN' \
-    'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
-    'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
-    'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
-    'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
-    'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
+    'no-receive NO_RECV LIVE' \
+    'no-forward NO_RECV,NO_FWD LIVE' \
+    'no-packet-in NO_RECV,NO_FWD,NO_PACKET_IN LIVE' \
+    'forward NO_RECV,NO_PACKET_IN LIVE' \
+    'packet-in NO_RECV LIVE' \
     'up NO_RECV LIVE' \
-    'receive 0 LIVE'
+    'receive 0 LIVE' \
+    'down PORT_DOWN LINK_DOWN'
 do
+    printf '\n--- %s --- \n\n' "$command_config_state"
     set $command_config_state
     command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
     AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
@@ -1298,38 +1356,6 @@ done
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
-AT_SETUP([ofproto - mod-port (OpenFlow 1.6)])
-OVS_VSWITCHD_START
-for command_config_state in \
-    'up 0 LIVE' \
-    'down PORT_DOWN LINK_DOWN' \
-    'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
-    'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
-    'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
-    'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
-    'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
-    'up NO_RECV LIVE' \
-    'receive 0 LIVE'
-do
-    set $command_config_state
-    command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
-    AT_CHECK([ovs-ofctl -O OpenFlow16 -vwarn mod-port br0 br0 $command])
-    AT_CHECK([ovs-ofctl -O OpenFlow16 -vwarn show br0], [0], [stdout])
-    AT_CHECK_UNQUOTED([strip_xids < stdout], [0], [dnl
-OFPT_FEATURES_REPLY (OF1.6): dpid:fedcba9876543210
-n_tables:254, n_buffers:0
-capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS BUNDLES
-OFPST_PORT_DESC reply (OF1.6):
- LOCAL(br0): addr:aa:55:aa:55:00:00
-     config:     $config
-     state:      $state
-     speed: 0 Mbps now, 0 Mbps max
-OFPT_GET_CONFIG_REPLY (OF1.6): frags=normal miss_send_len=0
-])
-done
-OVS_VSWITCHD_STOP
-AT_CLEANUP
-
 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
 OVS_VSWITCHD_START
 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
@@ -1402,6 +1428,7 @@ AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip], [0], [dnl
 OFPST_FLOW reply (OF1.4):
  check_overlap reset_counts in_port=1 actions=drop
 ])
+# OF1.5 makes the flags invisible.
 AT_CHECK([ovs-ofctl -O OpenFlow15 dump-flows br0 | ofctl_strip], [0], [dnl
 OFPST_FLOW reply (OF1.5):
  check_overlap reset_counts in_port=1 actions=drop
@@ -2178,27 +2205,11 @@ head_table() {
     active=0, lookup=0, matched=0
     max_entries=1000000
     matching:
-      in_port: exact match or wildcard
-      eth_src: exact match or wildcard
-      eth_dst: exact match or wildcard
-      eth_type: exact match or wildcard
-      vlan_vid: exact match or wildcard
-      vlan_pcp: exact match or wildcard
-      ip_src: exact match or wildcard
-      ip_dst: exact match or wildcard
-      nw_proto: exact match or wildcard
-      nw_tos: exact match or wildcard
-      tcp_src: exact match or wildcard
-      tcp_dst: exact match or wildcard
+      exact match or wildcard: in_port eth_{src,dst,type} vlan_{vid,pcp} ip_{src,dst} nw_{proto,tos} tcp_{src,dst}
 
 ' "$1"
 }
-ditto() {
-    for i in `seq $1 $2`; do
-        printf '  table %d: ditto\n' $i
-    done
-}
-(head_table; ditto 1 253) > expout
+(head_table; echo '  tables 1...253: ditto') > expout
 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
 # Change the configuration.
 AT_CHECK(
@@ -2220,7 +2231,7 @@ AT_CHECK(
     active=0, lookup=0, matched=0
     max_entries=1000000
     (same matching)
-'; ditto 3 253) > expout
+'; echo '  tables 3...253: ditto') > expout
 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
@@ -2254,27 +2265,11 @@ head_table() {
     active=0, lookup=0, matched=0
     max_entries=1000000
     matching:
-      in_port: exact match or wildcard
-      eth_src: exact match or wildcard
-      eth_dst: exact match or wildcard
-      eth_type: exact match or wildcard
-      vlan_vid: exact match or wildcard
-      vlan_pcp: exact match or wildcard
-      ip_src: exact match or wildcard
-      ip_dst: exact match or wildcard
-      nw_proto: exact match or wildcard
-      nw_tos: exact match or wildcard
-      tcp_src: exact match or wildcard
-      tcp_dst: exact match or wildcard
+      exact match or wildcard: in_port eth_{src,dst,type} vlan_{vid,pcp} ip_{src,dst} nw_{proto,tos} tcp_{src,dst}
 
 '
 }
-ditto() {
-    for i in `seq $1 $2`; do
-        printf '  table %d: ditto\n' $i
-    done
-}
-(head_table; ditto 1 253) > expout
+(head_table; echo '  tables 1...253: ditto') > expout
 AT_CHECK([ovs-ofctl dump-tables br0 | strip_xids], [0], [expout])
 OVS_VSWITCHD_STOP(["/240\.0\.0\.1/d"])
 AT_CLEANUP
@@ -2290,54 +2285,15 @@ head_table() {
     config=controller
     max_entries=1000000
     instructions (table miss and others):
-      instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table
+      instructions: apply_actions clear_actions write_actions write_metadata goto_table
       Write-Actions and Apply-Actions features:
         actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
-        supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll
+        supported on Set-Field: metadata in_port_oxm eth_{src,dst} vlan_{vid,pcp} mpls_{label,tc} ip_{src,dst} ipv6_{src,dst,label} ip_dscp nw_ecn arp_{op,spa,tpa,sha,tha} tcp_{src,dst} udp_{src,dst} sctp_{src,dst} icmp_{type,code} icmpv6_{type,code} nd_{target,sll,tll}
     matching:
-      metadata: exact match or wildcard
-      in_port_oxm: exact match or wildcard
-      eth_src: exact match or wildcard
-      eth_dst: exact match or wildcard
-      eth_type: exact match or wildcard
-      vlan_vid: exact match or wildcard
-      vlan_pcp: exact match or wildcard
-      mpls_label: exact match or wildcard
-      mpls_tc: exact match or wildcard
-      ip_src: exact match or wildcard
-      ip_dst: exact match or wildcard
-      ipv6_src: exact match or wildcard
-      ipv6_dst: exact match or wildcard
-      ipv6_label: exact match or wildcard
-      nw_proto: exact match or wildcard
-      ip_dscp: exact match or wildcard
-      nw_ecn: exact match or wildcard
-      arp_op: exact match or wildcard
-      arp_spa: exact match or wildcard
-      arp_tpa: exact match or wildcard
-      arp_sha: exact match or wildcard
-      arp_tha: exact match or wildcard
-      tcp_src: exact match or wildcard
-      tcp_dst: exact match or wildcard
-      udp_src: exact match or wildcard
-      udp_dst: exact match or wildcard
-      sctp_src: exact match or wildcard
-      sctp_dst: exact match or wildcard
-      icmp_type: exact match or wildcard
-      icmp_code: exact match or wildcard
-      icmpv6_type: exact match or wildcard
-      icmpv6_code: exact match or wildcard
-      nd_target: exact match or wildcard
-      nd_sll: exact match or wildcard
-      nd_tll: exact match or wildcard
+      exact match or wildcard: metadata in_port_oxm eth_{src,dst,type} vlan_{vid,pcp} mpls_{label,tc} ip_{src,dst} ipv6_{src,dst,label} nw_proto ip_dscp nw_ecn arp_{op,spa,tpa,sha,tha} tcp_{src,dst} udp_{src,dst} sctp_{src,dst} icmp_{type,code} icmpv6_{type,code} nd_{target,sll,tll}
 
 ' "$1"
 }
-ditto() {
-    for i in `seq $1 $2`; do
-        printf '  table %d: ditto\n' $i
-    done
-}
 tail_table() {
     printf '  table 253:
     active=0, lookup=0, matched=0
@@ -2345,12 +2301,12 @@ tail_table() {
     config=controller
     max_entries=1000000
     instructions (table miss and others):
-      instructions: apply_actions,clear_actions,write_actions,write_metadata
+      instructions: apply_actions clear_actions write_actions write_metadata
       (same actions)
     (same matching)
 '
 }
-(head_table; ditto 1 252; tail_table) > expout
+(head_table; printf '  tables 1...252: ditto\n\n'; tail_table) > expout
 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
 # Change the configuration.
 AT_CHECK(
@@ -2378,7 +2334,7 @@ AT_CHECK(
     max_entries=1000000
     (same instructions)
     (same matching)
-'; ditto 3 252; tail_table) > expout
+'; printf '  tables 3...252: ditto\n\n'; tail_table) > expout
 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
@@ -2391,221 +2347,28 @@ head_table () {
     max_entries=1000000
     instructions (table miss and others):
       next tables: 1-253
-      instructions: meter,apply_actions,clear_actions,write_actions,write_metadata,goto_table
+      instructions: meter apply_actions clear_actions write_actions write_metadata goto_table
       Write-Actions and Apply-Actions features:
         actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
-        supported on Set-Field: tun_id tun_src tun_dst tun_ipv6_src tun_ipv6_dst tun_flags tun_gbp_id tun_gbp_flags tun_metadata0 dnl
-tun_metadata1 tun_metadata2 tun_metadata3 tun_metadata4 tun_metadata5 tun_metadata6 tun_metadata7 tun_metadata8 tun_metadata9 tun_metadata10 tun_metadata11 tun_metadata12 tun_metadata13 tun_metadata14 tun_metadata15 tun_metadata16 tun_metadata17 tun_metadata18 tun_metadata19 tun_metadata20 tun_metadata21 tun_metadata22 tun_metadata23 tun_metadata24 tun_metadata25 tun_metadata26 tun_metadata27 tun_metadata28 tun_metadata29 tun_metadata30 tun_metadata31 tun_metadata32 tun_metadata33 tun_metadata34 tun_metadata35 tun_metadata36 tun_metadata37 tun_metadata38 tun_metadata39 tun_metadata40 tun_metadata41 tun_metadata42 tun_metadata43 tun_metadata44 tun_metadata45 tun_metadata46 tun_metadata47 tun_metadata48 tun_metadata49 tun_metadata50 tun_metadata51 tun_metadata52 tun_metadata53 tun_metadata54 tun_metadata55 tun_metadata56 tun_metadata57 tun_metadata58 tun_metadata59 tun_metadata60 tun_metadata61 tun_metadata62 tun_metadata63 dnl
-metadata in_port in_port_oxm pkt_mark ct_mark ct_label reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 reg9 reg10 reg11 reg12 reg13 reg14 reg15 xreg0 xreg1 xreg2 xreg3 xreg4 xreg5 xreg6 xreg7 xxreg0 xxreg1 xxreg2 xxreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc mpls_ttl ip_src ip_dst ipv6_src ipv6_dst ipv6_label nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst icmp_type icmp_code icmpv6_type icmpv6_code nd_target nd_sll nd_tll nsh_flags nsh_spi nsh_si nsh_c1 nsh_c2 nsh_c3 nsh_c4 nsh_ttl
+        supported on Set-Field: tun_{id,src,dst,ipv6_{src,dst},flags,gbp_{id,flags},erspan_{idx,ver,dir,hwid},metadata0...metadata63} metadata in_{port,port_oxm} pkt_mark ct_{mark,label} reg0...reg15 xreg0...xreg7 xxreg0...xxreg3 eth_{src,dst} vlan_{tci,vid,pcp} mpls_{label,tc,ttl} ip_{src,dst} ipv6_{src,dst,label} nw_tos ip_dscp nw_{ecn,ttl} arp_{op,spa,tpa,sha,tha} tcp_{src,dst} udp_{src,dst} sctp_{src,dst} icmp_{type,code} icmpv6_{type,code} nd_{target,sll,tll,reserved,options_type} nsh_{flags,spi,si,c1...c4,ttl}
     matching:
-      dp_hash: arbitrary mask
-      recirc_id: exact match or wildcard
-      packet_type: exact match or wildcard
-      conj_id: exact match or wildcard
-      tun_id: arbitrary mask
-      tun_src: arbitrary mask
-      tun_dst: arbitrary mask
-      tun_ipv6_src: arbitrary mask
-      tun_ipv6_dst: arbitrary mask
-      tun_flags: arbitrary mask
-      tun_gbp_id: arbitrary mask
-      tun_gbp_flags: arbitrary mask
-      tun_metadata0: arbitrary mask
-      tun_metadata1: arbitrary mask
-      tun_metadata2: arbitrary mask
-      tun_metadata3: arbitrary mask
-      tun_metadata4: arbitrary mask
-      tun_metadata5: arbitrary mask
-      tun_metadata6: arbitrary mask
-      tun_metadata7: arbitrary mask
-      tun_metadata8: arbitrary mask
-      tun_metadata9: arbitrary mask
-      tun_metadata10: arbitrary mask
-      tun_metadata11: arbitrary mask
-      tun_metadata12: arbitrary mask
-      tun_metadata13: arbitrary mask
-      tun_metadata14: arbitrary mask
-      tun_metadata15: arbitrary mask
-      tun_metadata16: arbitrary mask
-      tun_metadata17: arbitrary mask
-      tun_metadata18: arbitrary mask
-      tun_metadata19: arbitrary mask
-      tun_metadata20: arbitrary mask
-      tun_metadata21: arbitrary mask
-      tun_metadata22: arbitrary mask
-      tun_metadata23: arbitrary mask
-      tun_metadata24: arbitrary mask
-      tun_metadata25: arbitrary mask
-      tun_metadata26: arbitrary mask
-      tun_metadata27: arbitrary mask
-      tun_metadata28: arbitrary mask
-      tun_metadata29: arbitrary mask
-      tun_metadata30: arbitrary mask
-      tun_metadata31: arbitrary mask
-      tun_metadata32: arbitrary mask
-      tun_metadata33: arbitrary mask
-      tun_metadata34: arbitrary mask
-      tun_metadata35: arbitrary mask
-      tun_metadata36: arbitrary mask
-      tun_metadata37: arbitrary mask
-      tun_metadata38: arbitrary mask
-      tun_metadata39: arbitrary mask
-      tun_metadata40: arbitrary mask
-      tun_metadata41: arbitrary mask
-      tun_metadata42: arbitrary mask
-      tun_metadata43: arbitrary mask
-      tun_metadata44: arbitrary mask
-      tun_metadata45: arbitrary mask
-      tun_metadata46: arbitrary mask
-      tun_metadata47: arbitrary mask
-      tun_metadata48: arbitrary mask
-      tun_metadata49: arbitrary mask
-      tun_metadata50: arbitrary mask
-      tun_metadata51: arbitrary mask
-      tun_metadata52: arbitrary mask
-      tun_metadata53: arbitrary mask
-      tun_metadata54: arbitrary mask
-      tun_metadata55: arbitrary mask
-      tun_metadata56: arbitrary mask
-      tun_metadata57: arbitrary mask
-      tun_metadata58: arbitrary mask
-      tun_metadata59: arbitrary mask
-      tun_metadata60: arbitrary mask
-      tun_metadata61: arbitrary mask
-      tun_metadata62: arbitrary mask
-      tun_metadata63: arbitrary mask
-      metadata: arbitrary mask
-      in_port: exact match or wildcard
-      in_port_oxm: exact match or wildcard
-      actset_output: exact match or wildcard
-      pkt_mark: arbitrary mask
-      ct_state: arbitrary mask
-      ct_zone: exact match or wildcard
-      ct_mark: arbitrary mask
-      ct_label: arbitrary mask
-      ct_nw_proto: exact match or wildcard
-      ct_nw_src: arbitrary mask
-      ct_nw_dst: arbitrary mask
-      ct_ipv6_src: arbitrary mask
-      ct_ipv6_dst: arbitrary mask
-      ct_tp_src: arbitrary mask
-      ct_tp_dst: arbitrary mask
-      reg0: arbitrary mask
-      reg1: arbitrary mask
-      reg2: arbitrary mask
-      reg3: arbitrary mask
-      reg4: arbitrary mask
-      reg5: arbitrary mask
-      reg6: arbitrary mask
-      reg7: arbitrary mask
-      reg8: arbitrary mask
-      reg9: arbitrary mask
-      reg10: arbitrary mask
-      reg11: arbitrary mask
-      reg12: arbitrary mask
-      reg13: arbitrary mask
-      reg14: arbitrary mask
-      reg15: arbitrary mask
-      xreg0: arbitrary mask
-      xreg1: arbitrary mask
-      xreg2: arbitrary mask
-      xreg3: arbitrary mask
-      xreg4: arbitrary mask
-      xreg5: arbitrary mask
-      xreg6: arbitrary mask
-      xreg7: arbitrary mask
-      xxreg0: arbitrary mask
-      xxreg1: arbitrary mask
-      xxreg2: arbitrary mask
-      xxreg3: arbitrary mask
-      eth_src: arbitrary mask
-      eth_dst: arbitrary mask
-      eth_type: exact match or wildcard
-      vlan_tci: arbitrary mask
-      vlan_vid: arbitrary mask
-      vlan_pcp: exact match or wildcard
-      mpls_label: exact match or wildcard
-      mpls_tc: exact match or wildcard
-      mpls_bos: exact match or wildcard
-      mpls_ttl: exact match or wildcard
-      ip_src: arbitrary mask
-      ip_dst: arbitrary mask
-      ipv6_src: arbitrary mask
-      ipv6_dst: arbitrary mask
-      ipv6_label: arbitrary mask
-      nw_proto: exact match or wildcard
-      nw_tos: exact match or wildcard
-      ip_dscp: exact match or wildcard
-      nw_ecn: exact match or wildcard
-      nw_ttl: exact match or wildcard
-      ip_frag: arbitrary mask
-      arp_op: exact match or wildcard
-      arp_spa: arbitrary mask
-      arp_tpa: arbitrary mask
-      arp_sha: arbitrary mask
-      arp_tha: arbitrary mask
-      tcp_src: arbitrary mask
-      tcp_dst: arbitrary mask
-      tcp_flags: arbitrary mask
-      udp_src: arbitrary mask
-      udp_dst: arbitrary mask
-      sctp_src: arbitrary mask
-      sctp_dst: arbitrary mask
-      icmp_type: exact match or wildcard
-      icmp_code: exact match or wildcard
-      icmpv6_type: exact match or wildcard
-      icmpv6_code: exact match or wildcard
-      nd_target: arbitrary mask
-      nd_sll: arbitrary mask
-      nd_tll: arbitrary mask
-      nsh_flags: arbitrary mask
-      nsh_mdtype: exact match or wildcard
-      nsh_np: exact match or wildcard
-      nsh_spi: exact match or wildcard
-      nsh_si: exact match or wildcard
-      nsh_c1: arbitrary mask
-      nsh_c2: arbitrary mask
-      nsh_c3: arbitrary mask
-      nsh_c4: arbitrary mask
-      nsh_ttl: exact match or wildcard
+      arbitrary mask: dp_hash tun_{id,src,dst,ipv6_{src,dst},flags,gbp_{id,flags},erspan_{idx,ver,dir,hwid},gtpu_{flags,msgtype},metadata0...metadata63} metadata pkt_mark ct_{state,mark,label,nw_{src,dst},ipv6_{src,dst},tp_{src,dst}} reg0...reg15 xreg0...xreg7 xxreg0...xxreg3 eth_{src,dst} vlan_{tci,vid} ip_{src,dst} ipv6_{src,dst,label} ip_frag arp_{spa,tpa,sha,tha} tcp_{src,dst,flags} udp_{src,dst} sctp_{src,dst} nd_{target,sll,tll} nsh_{flags,c1...c4}
+      exact match or wildcard: recirc_id packet_type conj_id in_{port,port_oxm} actset_output ct_{zone,nw_proto} eth_type vlan_pcp mpls_{label,tc,bos,ttl} nw_{proto,tos} ip_dscp nw_{ecn,ttl} arp_op icmp_{type,code} icmpv6_{type,code} nd_{reserved,options_type} nsh_{mdtype,np,spi,si,ttl}
 
 ' "$1"
 }
-ditto() {
-    printf '  table %d:
-    metadata: match=0xffffffffffffffff write=0xffffffffffffffff
-    max_entries=%d
-    instructions (table miss and others):
-      next tables: %d-253
-      (same instructions)
-      (same actions)
-    (same matching)
-
-' $1 $2 `expr $1 + 1`
-}
 tail_tables() {
-echo '  table 252:
-    metadata: match=0xffffffffffffffff write=0xffffffffffffffff
-    max_entries=1000000
-    instructions (table miss and others):
-      next tables: 253
-      (same instructions)
-      (same actions)
-    (same matching)
-
-  table 253:
+echo '  table 253:
     metadata: match=0xffffffffffffffff write=0xffffffffffffffff
     max_entries=1000000
     instructions (table miss and others):
-      instructions: meter,apply_actions,clear_actions,write_actions,write_metadata
+      instructions: meter apply_actions clear_actions write_actions write_metadata
       (same actions)
     (same matching)
 '
 }
 (head_table
- for i in `seq 1 251`; do
-     ditto $i 1000000
- done
+ printf '  tables 1...252: ditto\n\n'
  tail_tables) > expout
 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
 # Change the configuration.
@@ -2620,10 +2383,20 @@ AT_CHECK(
 ])
 # Check that the configuration was updated.
 (head_table ' ("main")'
- ditto 1 1024
- for i in `seq 2 251`; do
-     ditto $i 1000000
- done
+ echo '  table 1:
+    metadata: match=0xffffffffffffffff write=0xffffffffffffffff
+    max_entries=1024
+    (same instructions)
+    (same matching)
+
+  table 2:
+    metadata: match=0xffffffffffffffff write=0xffffffffffffffff
+    max_entries=1000000
+    (same instructions)
+    (same matching)
+
+  tables 3...252: ditto
+'
  tail_tables) > expout
 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0], [0], [expout])
 OVS_VSWITCHD_STOP
@@ -2632,6 +2405,19 @@ AT_CLEANUP
 AT_SETUP([ofproto - flow table names])
 OVS_VSWITCHD_START
 add_of_ports br0 1 2
+
+# Set a table name via OpenFlow 1.3 and one via OpenFlow 1.5.
+AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 0 name:xyzzy])
+AT_CHECK([ovs-ofctl -O OpenFlow15 mod-table br0 1 name:quux])
+AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^  table'],
+  [0], [dnl
+  table 0 ("xyzzy"):
+  table 1 ("quux"): ditto
+  tables 2...252: ditto
+  table 253:
+])
+
+# Set some table names via OVSDB.
 AT_CHECK(
   [ovs-vsctl \
      -- --id=@t0 create Flow_Table name=zero \
@@ -2643,6 +2429,16 @@ AT_CHECK(
 <1>
 <2>
 ])
+AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^  table'],
+  [0], [dnl
+  table 0 ("zero"):
+  table 1 ("one"): ditto
+  table 2 ("two"): ditto
+  tables 3...252: ditto
+  table 253:
+])
+
+# Check that flow table parsing and dumping uses the names.
 AT_DATA([flows.txt], [dnl
 table=zero in_port=p2 actions=p1,resubmit(,one)
 table=one,in_port=p1,ip,actions=ct(table=two)
@@ -2659,6 +2455,73 @@ AT_CHECK([ovs-ofctl --no-names --no-stats dump-flows br0], [0], [dnl
  table=1, ip,in_port=1 actions=ct(table=2)
  table=1, arp,in_port=1 actions=resubmit(,2)
 ])
+
+# Setting the same table names via OpenFlow 1.3 or OpenFlow 1.5 is a no-op.
+AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 0 name:zero])
+AT_CHECK([ovs-ofctl -O OpenFlow15 mod-table br0 1 name:one])
+AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^  table'],
+  [0], [dnl
+  table 0 ("zero"):
+  table 1 ("one"): ditto
+  table 2 ("two"): ditto
+  tables 3...252: ditto
+  table 253:
+])
+
+# Setting different tables names via OpenFlow 1.3 or OpenFlow 1.5 yield errors.
+AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 0 name:xyzzy], 1, [], [stderr])
+AT_CHECK([head -1 stderr], [0], [OFPT_ERROR (OF1.3) (xid=0x5): OFPTFFC_EPERM
+])
+AT_CHECK([ovs-ofctl -O OpenFlow15 mod-table br0 1 name:quux], 1, [], [stderr])
+AT_CHECK([head -1 stderr], [0], [OFPT_ERROR (OF1.5) (xid=0x5): OFPTFFC_EPERM
+])
+
+# But we can still set table names for those not set via OVSDB.
+AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 3 name:three])
+AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^  table'],
+  [0], [dnl
+  table 0 ("zero"):
+  table 1 ("one"): ditto
+  table 2 ("two"): ditto
+  table 3 ("three"): ditto
+  tables 4...252: ditto
+  table 253:
+])
+
+# Unsetting names via OVSDB then setting them via OpenFlow works too.
+AT_CHECK([ovs-vsctl remove bridge br0 Flow_Table 2])
+AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^  table'],
+  [0], [dnl
+  table 0 ("zero"):
+  table 1 ("one"): ditto
+  table 2: ditto
+  table 3 ("three"): ditto
+  tables 4...252: ditto
+  table 253:
+])
+AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 2 name:foobar])
+AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^  table'],
+  [0], [dnl
+  table 0 ("zero"):
+  table 1 ("one"): ditto
+  table 2 ("foobar"): ditto
+  table 3 ("three"): ditto
+  tables 4...252: ditto
+  table 253:
+])
+
+# We can clear names via OpenFlow, at least if they were set that way.
+AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 2 name:])
+AT_CHECK([ovs-ofctl -O OpenFlow15 dump-table-features br0 |grep '^  table'],
+  [0], [dnl
+  table 0 ("zero"):
+  table 1 ("one"): ditto
+  table 2: ditto
+  table 3 ("three"): ditto
+  tables 4...252: ditto
+  table 253:
+])
+
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
@@ -3216,7 +3079,7 @@ OVS_VSWITCHD_STOP
 AT_CLEANUP
 
 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
-OVS_VSWITCHD_START
+OVS_VSWITCHD_START([set bridge br0 other_config:hwaddr=00:01:02:03:04:05])
 AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile])
 check_async () {
     printf '\n\n--- check_async %d ---\n\n\n' $1
@@ -3251,8 +3114,8 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172
     ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
     if test X"$1" = X"OFPPR_ADD"; then shift;
         echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
@@ -3260,8 +3123,8 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172
     ovs-vsctl del-port br0 test
     if test X"$1" = X"OFPPR_DELETE"; then shift;
         echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
@@ -3294,7 +3157,7 @@ check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
 
-# Become slave, which should disable everything except port status.
+# Become secondary, which should disable everything except port status.
 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
 check_async 4 OFPPR_ADD OFPPR_DELETE
 
@@ -3309,7 +3172,7 @@ check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
 # Restore controller ID 0.
 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
 
-# Become master.
+# Become primary.
 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
 check_async 7 OFPR_ACTION OFPPR_ADD
 
@@ -3354,8 +3217,12 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172
     ovs-vsctl add-port br0 test -- set Interface test type=dummy
     if test X"$1" = X"OFPPR_ADD"; then shift;
         echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
+     speed: 0 Mbps now, 0 Mbps max
+OFPT_PORT_STATUS (OF1.2): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
@@ -3363,8 +3230,8 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172
     ovs-vsctl del-port br0 test
     if test X"$1" = X"OFPPR_DELETE"; then shift;
         echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
@@ -3397,7 +3264,7 @@ check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
 
-# Become slave (OF 1.2), which should disable everything except port status.
+# Become secondary (OF 1.2), which should disable everything except port status.
 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
 check_async 4 OFPPR_ADD OFPPR_DELETE
 
@@ -3412,7 +3279,7 @@ check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
 # Restore controller ID 0.
 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
 
-# Become master (OF 1.2).
+# Become primary (OF 1.2).
 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
 check_async 7 OFPR_ACTION OFPPR_ADD
 
@@ -3464,8 +3331,12 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172
     ovs-vsctl add-port br0 test -- set Interface test type=dummy
     if test X"$1" = X"OFPPR_ADD"; then shift;
         echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
+     speed: 0 Mbps now, 0 Mbps max
+OFPT_PORT_STATUS (OF1.3): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
@@ -3473,8 +3344,8 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172
     ovs-vsctl del-port br0 test
     if test X"$1" = X"OFPPR_DELETE"; then shift;
         echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
@@ -3512,7 +3383,7 @@ check_async 1
 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
 
-# Become slave (OF 1.3), which should disable everything except port status.
+# Become secondary (OF 1.3), which should disable everything except port status.
 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
 check_async 3 OFPPR_ADD OFPPR_DELETE
 
@@ -3527,7 +3398,7 @@ check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
 # Restore controller ID 0.
 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
 
-# Become master (OF 1.3).
+# Become primary (OF 1.3).
 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
 check_async 6 OFPR_ACTION OFPPR_ADD
 
@@ -3540,127 +3411,145 @@ OVS_VSWITCHD_START([dnl
     add-port br0 p1 -- set Interface p1 type=dummy ofport_request=10
 ])
 AT_CHECK([ovs-ofctl -O OpenFlow14 -P standard monitor br0 --detach --no-chdir --pidfile])
+ovs_appctl () {
+    echo ovs-appctl "$@"
+    AT_CHECK([ovs-appctl "$@"], [0], [ignore], [ignore])
+}
+ovs_ofctl () {
+    echo ovs-ofctl --no-names "$@"
+    AT_CHECK([ovs-ofctl --no-names "$@"])
+}
+ovs_vsctl () {
+    echo ovs-vsctl "$@"
+    AT_CHECK([ovs-vsctl "$@"])
+}
 check_async () {
     printf '\n\n--- check_async %d ---\n\n\n' $1
     INDEX=$1
     shift
 
-    ovs-appctl -t ovs-ofctl ofctl/barrier
-    ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
+    ovs_appctl -t ovs-ofctl ofctl/barrier
+    ovs_appctl -t ovs-ofctl ofctl/set-output-file monitor.log
     : > expout
 
     # OFPT_PACKET_IN, OFPR_PACKET_OUT (controller_id=0)
-    ovs-ofctl -O OpenFlow14 -v packet-out br0 none controller '0001020304050010203040501234'
+    ovs_ofctl -O OpenFlow14 packet-out br0 none controller '0001020304050010203040501234'
     if test X"$1" = X"OFPR_PACKET_OUT"; then shift;
         echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via packet_out) data_len=14 (unbuffered)
 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
     fi
 
     # OFPT_PACKET_IN, OFPR_ACTION_SET (controller_id=0)
-    ovs-ofctl -O OpenFlow14 add-flow br0 'in_port=10 actions=write_actions(output(CONTROLLER))'
-    ovs-appctl netdev-dummy/receive p1 'in_port(10),eth(src=00:10:20:30:40:50,dst=00:01:02:03:04:05),eth_type(0x1234)'
+    ovs_ofctl -O OpenFlow14 add-flow br0 'in_port=10 actions=write_actions(output(CONTROLLER))'
+    ovs_appctl netdev-dummy/receive p1 'in_port(10),eth(src=00:10:20:30:40:50,dst=00:01:02:03:04:05),eth_type(0x1234)'
     if test X"$1" = X"OFPR_ACTION_SET"; then shift;
         echo >>expout "OFPT_PACKET_IN (OF1.4): cookie=0x0 total_len=14 in_port=10 (via action_set) data_len=14 (unbuffered)
 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
     fi
 
     # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
-    ovs-ofctl -O OpenFlow14 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
+    ovs_ofctl -O OpenFlow14  packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
     if test X"$1" = X"OFPR_NO_MATCH"; then shift;
         echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
     fi
 
     # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
-    ovs-ofctl -O OpenFlow14 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
+    ovs_ofctl -O OpenFlow14 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
     if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
         echo >>expout "OFPT_PACKET_IN (OF1.4): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
 udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
     fi
 
 # OFPT_PORT_STATUS, OFPPR_ADD
-    ovs-vsctl add-port br0 test -- set Interface test type=dummy
+    ovs_vsctl add-port br0 test -- set Interface test type=dummy
     if test X"$1" = X"OFPPR_ADD"; then shift;
         echo >>expout "OFPT_PORT_STATUS (OF1.4): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
+     speed: 0 Mbps now, 0 Mbps max
+OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
     # OFPT_PORT_STATUS, OFPPR_MODIFY
-    ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 test up
+    ovs_ofctl -O OpenFlow14 -vwarn mod-port br0 test down
     if test X"$1" = X"OFPPR_MODIFY"; then shift;
         echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     0
-     state:      LINK_DOWN
+     config:     PORT_DOWN
+     state:      0
      speed: 0 Mbps now, 0 Mbps max
 OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     0
-     state:      LIVE
+     config:     PORT_DOWN
+     state:      LINK_DOWN
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
     # OFPT_PORT_STATUS, OFPPR_DELETE
-    ovs-vsctl del-port br0 test
+    ovs_vsctl del-port br0 test
     if test X"$1" = X"OFPPR_DELETE"; then shift;
         echo >>expout "OFPT_PORT_STATUS (OF1.4): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     0
-     state:      LIVE
+     config:     PORT_DOWN
+     state:      LINK_DOWN
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
     # OFPT_FLOW_REMOVED, OFPRR_DELETE
-    ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=drop
-    ovs-ofctl -O OpenFlow14 --strict del-flows br0 ''
+    ovs_ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=drop
+    ovs-ofctl -O OpenFlow14 dump-flows br0
+    ovs_ofctl -O OpenFlow14 --strict del-flows br0 ''
+    ovs-ofctl -O OpenFlow14 dump-flows br0
     if test X"$1" = X"OFPRR_DELETE"; then shift;
         echo >>expout "OFPT_FLOW_REMOVED (OF1.4):  reason=delete table_id=0"
     fi
 
     # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
-    ovs-ofctl -O OpenFlow14 add-group br0 group_id=1234,type=all,bucket=output:10
-    ovs-ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=group:1234
-    ovs-ofctl -O OpenFlow14 --strict del-groups br0 group_id=1234
+    ovs_ofctl -O OpenFlow14 add-group br0 group_id=1234,type=all,bucket=output:10
+    ovs_ofctl -O OpenFlow14 add-flow br0 send_flow_rem,actions=group:1234
+    ovs_ofctl -O OpenFlow14 --strict del-groups br0 group_id=1234
     if test X"$1" = X"OFPRR_GROUP_DELETE"; then shift;
         echo >>expout "OFPT_FLOW_REMOVED (OF1.4):  reason=group_delete table_id=0"
     fi
 
     # OFPT_TABLE_STATUS, OFPTR_VACANCY_UP
     if test X"$1" = X"OFPTR_VACANCY_UP"; then shift;
-        ovs-vsctl -- --id=@t1 create Flow_Table flow-limit=10 -- set bridge br0 flow_tables:1=@t1
-
-       # Turn on vacancy events, then add flows until we're full.
-       # With initial vacancy of 100% and vacancy_up of 80%, so that
-       # vacancy >= vacancy_up, this enables VACANY_DOWN events, so
-       # we get a single such message when vacancy dips below 20%.
-        ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
+        AT_CHECK([ovs-vsctl -- --id=@t1 create Flow_Table flow-limit=10 -- set bridge br0 flow_tables:1=@t1], [0], [ignore], [])
+
+        # Turn on vacancy events, then add flows until we're full.
+        # With initial vacancy of 100% and vacancy_up of 80%, so that
+        # vacancy >= vacancy_up, this enables VACANY_DOWN events, so
+        # we get a single such message when vacancy dips below 20%.
+        ovs_ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
         echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_DOWN
 table_desc:-
   table 1:
    eviction=off eviction_flags=OTHER|IMPORTANCE|LIFETIME
    vacancy=on vacancy_down=20% vacancy_up=80% vacancy=10%"
         # Then delete flows until we're empty.  Sending the
-       # VACANCY_DOWN message enabled VACANCY_UP events, so we get a
-       # single such message when vacancy rises above 80%.
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
+        # VACANCY_DOWN message enabled VACANCY_UP events, so we get a
+        # single such message when vacancy rises above 80%.
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
         echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP
 table_desc:-
   table 1:
@@ -3668,33 +3557,33 @@ table_desc:-
    vacancy=on vacancy_down=20% vacancy_up=80% vacancy=90%"
 
         # Now approach vacancy from the other direction.  First
-       # disable vacancy events.  With initial vacancy of 70%, so
-       # that vacancy < vacancy_up, this enables VACANCY_UP events.
-       # That means that filling up the table generates no message,
-       # but deleting all the flows generates VACANCY_UP at the point
-       # vacancy rises above 80%.
-        ovs-ofctl -O OpenFlow14 mod-table br0 1 novacancy
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
-        ovs-ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
-        ovs-ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
-        ovs-ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
+        # disable vacancy events.  With initial vacancy of 70%, so
+        # that vacancy < vacancy_up, this enables VACANCY_UP events.
+        # That means that filling up the table generates no message,
+        # but deleting all the flows generates VACANCY_UP at the point
+        # vacancy rises above 80%.
+        ovs_ofctl -O OpenFlow14 mod-table br0 1 novacancy
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=1,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=2,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=3,actions=2
+        ovs_ofctl -O OpenFlow14 mod-table br0 1 vacancy:20,80
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=4,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=5,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=6,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=7,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=8,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=9,actions=2
+        ovs_ofctl -O OpenFlow14 add-flow br0 table=1,in_port=10,actions=2
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=1
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=2
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=3
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=4
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=5
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=6
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=7
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=8
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=9
+        ovs_ofctl -O OpenFlow14 del-flows br0 table=1,in_port=10
         echo >>expout "OFPT_TABLE_STATUS (OF1.4): reason=VACANCY_UP
 table_desc:-
   table 1:
@@ -3704,13 +3593,18 @@ table_desc:-
 
     AT_FAIL_IF([test X"$1" != X])
 
-    OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`])
+    normalize_log () {
+       sed '
+s/ (xid=0x[[0-9a-fA-F]]*)//
+s/ *duration.*//
+s/00:0.$/00:0x/' < monitor.log
+    }
+
+    OVS_WAIT_UNTIL([test `wc -l < "monitor.log"` -ge `wc -l < "expout"`],
+                   [normalize_log | diff -u - expout])
 
     AT_CHECK(
-      [[sed '
-s/ (xid=0x[0-9a-fA-F]*)//
-s/ *duration.*//
-s/00:0.$/00:0x/' < monitor.log]],
+      [normalize_log],
       [0], [expout])
 }
 
@@ -3718,26 +3612,26 @@ s/00:0.$/00:0x/' < monitor.log]],
 check_async 1
 
 # Set miss_send_len to 128, turning on packet-ins for our service connection.
-ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
+ovs_appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
 check_async 2 OFPR_PACKET_OUT OFPR_ACTION_SET OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
 
-# Become slave (OF 1.4), which should disable everything except port status.
-ovs-appctl -t ovs-ofctl ofctl/send 051800180000000200000003000000000000000000000001
+# Become secondary (OF 1.4), which should disable everything except port status.
+ovs_appctl -t ovs-ofctl ofctl/send 051800180000000200000003000000000000000000000001
 check_async 3 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
 
 # Use OF 1.4 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
-ovs-appctl -t ovs-ofctl ofctl/send 051c0040000000020000000800000005000100080000002000020008000000020003000800000005000400080000001c00050008000000050008000800000018
+ovs_appctl -t ovs-ofctl ofctl/send 051c0040000000020000000800000005000100080000002000020008000000020003000800000005000400080000001c00050008000000050008000800000018
 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE OFPTR_VACANCY_UP
 
 # Set controller ID 123.
-ovs-appctl -t ovs-ofctl ofctl/send 05040018000000030000232000000014000000000000007b
+ovs_appctl -t ovs-ofctl ofctl/send 05040018000000030000232000000014000000000000007b
 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE OFPRR_GROUP_DELETE
 
 # Restore controller ID 0.
-ovs-appctl -t ovs-ofctl ofctl/send 050400180000000300002320000000140000000000000000
+ovs_appctl -t ovs-ofctl ofctl/send 050400180000000300002320000000140000000000000000
 
-# Become master (OF 1.4).
-ovs-appctl -t ovs-ofctl ofctl/send 051800180000000400000002000000000000000000000002
+# Become primary (OF 1.4).
+ovs_appctl -t ovs-ofctl ofctl/send 051800180000000400000002000000000000000000000002
 check_async 6 OFPR_PACKET_OUT OFPPR_ADD OFPPR_MODIFY OFPRR_DELETE
 
 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
@@ -3763,21 +3657,25 @@ check_async () {
     ovs-vsctl add-port br0 test -- set Interface test type=dummy
     if test X"$1" = X"OFPPR_ADD"; then shift;
         echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     PORT_DOWN
-     state:      LINK_DOWN
+     config:     0
+     state:      0
+     speed: 0 Mbps now, 0 Mbps max
+OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
+     config:     0
+     state:      LIVE
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
     # OFPT_PORT_STATUS, OFPPR_MODIFY
-    ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up
+    ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test down
     if test X"$1" = X"OFPPR_MODIFY"; then shift;
         echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     0
-     state:      LINK_DOWN
+     config:     PORT_DOWN
+     state:      0
      speed: 0 Mbps now, 0 Mbps max
-OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
-     config:     0
-     state:      LIVE
+OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
+     config:     PORT_DOWN
+     state:      LINK_DOWN
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
@@ -3785,8 +3683,8 @@ OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
     ovs-vsctl del-port br0 test
     if test X"$1" = X"OFPPR_DELETE"; then shift;
         echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
-     config:     0
-     state:      LIVE
+     config:     PORT_DOWN
+     state:      LINK_DOWN
      speed: 0 Mbps now, 0 Mbps max"
     fi
 
@@ -3842,27 +3740,27 @@ for i in 1 2; do
     echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
 done
 
-# controller 1: Become slave (generation_id is initially undefined, so
+# controller 1: Become secondary (generation_id is initially undefined, so
 # 2^63+2 should not be stale)
 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
-echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
-echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
+echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=secondary generation_id=9223372036854775810"
+echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=secondary generation_id=9223372036854775810"
 
-# controller 2: Become master.
+# controller 2: Become primary.
 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
-echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
-echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
+echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=primary generation_id=9223372036854775811"
+echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=primary generation_id=9223372036854775811"
 
-# controller 1: Try to become the master using a stale generation ID
+# controller 1: Try to become the primary using a stale generation ID
 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
-echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
+echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=primary generation_id=3"
 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
-echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
+echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=primary generation_id=3"
 
-# controller 1: Become master using a valid generation ID
+# controller 1: Become primary using a valid generation ID
 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
-echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
-echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
+echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=primary generation_id=1"
+echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=primary generation_id=1"
 
 for i in 1 2; do
     ovs-appctl -t `pwd`/c$i ofctl/barrier
@@ -3881,8 +3779,8 @@ AT_CLEANUP
 
 dnl This test checks that the role request/response messaging works,
 dnl that generation_id is handled properly, and that role status update
-dnl messages are sent when a controller's role gets changed from master
-dnl to slave.
+dnl messages are sent when a controller's role gets changed from primary
+dnl to secondary.
 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
 OVS_VSWITCHD_START
 on_exit 'kill `cat c1.pid c2.pid`'
@@ -3907,28 +3805,28 @@ for i in 1 2; do
     echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
 done
 
-# controller 1: Become slave (generation_id is initially undefined, so
+# controller 1: Become secondary (generation_id is initially undefined, so
 # 2^63+2 should not be stale)
 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
-echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
-echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
+echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=secondary generation_id=9223372036854775810"
+echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=secondary generation_id=9223372036854775810"
 
-# controller 2: Become master.
+# controller 2: Become primary.
 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
-echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
-echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
+echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=primary generation_id=9223372036854775811"
+echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=primary generation_id=9223372036854775811"
 
-# controller 1: Try to become the master using a stale generation ID
+# controller 1: Try to become the primary using a stale generation ID
 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
-echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
+echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=primary generation_id=3"
 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
-echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
+echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=primary generation_id=3"
 
-# controller 1: Become master using a valid generation ID
+# controller 1: Become primary using a valid generation ID
 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
-echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
-echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
-echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
+echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=primary generation_id=1"
+echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=primary generation_id=1"
+echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=secondary generation_id=1 reason=primary_request"
 
 for i in 1 2; do
     ovs-appctl -t `pwd`/c$i ofctl/barrier
@@ -3945,6 +3843,72 @@ done
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
+dnl This test checks that the role request/response messaging works,
+dnl that generation_id is handled properly, and that role status update
+dnl messages are sent when a controller's role gets changed from primary
+dnl to secondary.
+AT_SETUP([ofproto - controller role (OpenFlow 1.3)])
+OVS_VSWITCHD_START
+on_exit 'kill `cat c1.pid c2.pid`'
+
+# Start two ovs-ofctl controller processes.
+AT_CAPTURE_FILE([monitor1.log])
+AT_CAPTURE_FILE([expout1])
+AT_CAPTURE_FILE([experr1])
+AT_CAPTURE_FILE([monitor2.log])
+AT_CAPTURE_FILE([expout2])
+AT_CAPTURE_FILE([experr2])
+for i in 1 2; do
+     AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c$i.pid --unixctl=c$i])
+    ovs-appctl -t `pwd`/c$i ofctl/barrier
+    ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
+    : > expout$i
+    : > experr$i
+
+    # find out current role
+    ovs-appctl -t `pwd`/c$i ofctl/send 041800180000000200000000000000000000000000000000
+    echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.3): role=nochange"
+    echo >>expout$i "OFPT_ROLE_REPLY (OF1.3): role=equal"
+done
+
+# controller 1: Become secondary (generation_id is initially undefined, so
+# 2^63+2 should not be stale)
+ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000300000003000000008000000000000002
+echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.3): role=secondary generation_id=9223372036854775810"
+echo >>expout1 "OFPT_ROLE_REPLY (OF1.3): role=secondary generation_id=9223372036854775810"
+
+# controller 2: Become primary.
+ovs-appctl -t `pwd`/c2 ofctl/send 041800180000000300000002000000008000000000000003
+echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.3): role=primary generation_id=9223372036854775811"
+echo >>expout2 "OFPT_ROLE_REPLY (OF1.3): role=primary generation_id=9223372036854775811"
+
+# controller 1: Try to become the primary using a stale generation ID
+ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000400000002000000000000000000000003
+echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.3): role=primary generation_id=3"
+echo >>expout1 "OFPT_ERROR (OF1.3): OFPRRFC_STALE"
+echo >>expout1 "OFPT_ROLE_REQUEST (OF1.3): role=primary generation_id=3"
+
+# controller 1: Become primary using a valid generation ID
+ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000500000002000000000000000000000001
+echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.3): role=primary generation_id=1"
+echo >>expout1 "OFPT_ROLE_REPLY (OF1.3): role=primary generation_id=1"
+echo >>expout2 "ONFT_ROLE_STATUS (OF1.3): role=secondary generation_id=1 reason=primary_request"
+
+for i in 1 2; do
+    ovs-appctl -t `pwd`/c$i ofctl/barrier
+    echo >>expout$i "OFPT_BARRIER_REPLY (OF1.3):"
+done
+
+# Check output.
+for i in 1 2; do
+    cp expout$i expout
+    AT_CHECK([grep -v '^send:' monitor$i.log | strip_xids], [0], [expout])
+    cp experr$i expout
+    AT_CHECK([grep '^send:' monitor$i.log | strip_xids], [0], [expout])
+done
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
 dnl This test checks the Group and meter notifications when a group mod
 dnl command is sent from one controller and the reply is received by
 dnl other controllers.
@@ -4014,13 +3978,13 @@ s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
     done
 }
 
-# controller 1: Become slave
+# controller 1: Become secondary
 ovs-appctl -t `pwd`/c1 ofctl/send 061800180000000300000003000000008000000000000002
 
-# controller 2: Become master
+# controller 2: Become primary
 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
 
-# controller 1: Become slave
+# controller 1: Become secondary
 ovs-appctl -t `pwd`/c3 ofctl/send 051800180000000300000003000000008000000000000004
 
 # controller 1: Enabled requestforward using set Asynchronous message
@@ -4036,6 +4000,205 @@ check_async 1 OFPGC_ADD OFPGC_MODIFY
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
+dnl This test checks the backwards compatibility of the NXT_REQUESTFORWARD
+dnl message type to OpenFlow 1.0, also relying on the Nicira Extensions:
+dnl NXT_GROUP_MOD, NXT_ROLE_REQUEST, and OFPRAW_NXT_SET_ASYNC_CONFIG2,
+dnl while also testing the functionality of the previous test.
+AT_SETUP([ofproto - NXT requestforward (OpenFlow 1.0)])
+OVS_VSWITCHD_START
+on_exit 'kill `cat c1.pid c2.pid c3.pid`'
+
+# Start two ovs-ofctl controller processes.
+AT_CAPTURE_FILE([monitor1.log])
+AT_CAPTURE_FILE([expout1])
+AT_CAPTURE_FILE([monitor2.log])
+AT_CAPTURE_FILE([expout2])
+AT_CAPTURE_FILE([monitor3.log])
+AT_CAPTURE_FILE([expout3])
+
+ovs-ofctl -O OpenFlow10 monitor br0 --detach --no-chdir --pidfile=c1.pid --unixctl=c1
+ovs-ofctl -O OpenFlow10 monitor br0 --detach --no-chdir --pidfile=c2.pid --unixctl=c2
+ovs-ofctl -O OpenFlow10 monitor br0 --detach --no-chdir --pidfile=c3.pid --unixctl=c3
+
+check_async () {
+    for i in 1 3; do
+        ovs-appctl -t `pwd`/c$i ofctl/barrier
+        ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
+        : > expout$i
+    done
+
+    printf '\n\n--- check_async %d ---\n\n\n' $1
+    INDEX=$1
+    shift
+
+    # OFPGC_ADD
+    # NXT_GROUP_MOD (xid=0x2):
+    # ADD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3
+    ovs-appctl -t `pwd`/c2 ofctl/send "01 04 00 a8 00 00 00 02 00 00 23 20 00 00 00 1f 00 00 01 00 87 65 43 21 00 60 00 00 ff ff ff ff 00 20 00 08 00 00 00 00 00 00 00 08 00 01 00 00 00 00 00 08 00 64 00 00 00 01 00 08 00 00 00 01 00 20 00 08 00 00 00 01 00 00 00 08 00 02 00 00 00 00 00 08 00 c8 00 00 00 01 00 08 00 00 00 02 00 20 00 08 00 00 00 02 00 00 00 08 00 03 00 00 00 00 00 08 00 c8 00 00 00 01 00 08 00 00 00 03 ff ff 00 28 00 00 15 40 00 00 00 01 00 00 00 00 68 61 73 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07"
+    if test X"$1" = X"OFPGC_ADD"; then shift;
+        echo >>expout2 "send: NXT_GROUP_MOD:
+ ADD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3"
+        echo >>expout1 "NXT_REQUESTFORWARD: reason=group_mod
+ ADD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3"
+        echo >>expout3 "NXT_REQUESTFORWARD: reason=group_mod
+ ADD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:100,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:200,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:200,watch_port:3,actions=output:3"
+    fi
+
+    # OFPGC_MODIFY
+    # NXT_GROUP_MOD (xid=0x2):
+    # MOD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:150,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:150,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:150,watch_port:3,actions=output:3
+    ovs-appctl -t `pwd`/c2 ofctl/send "01 04 00 a8 00 00 00 02 00 00 23 20 00 00 00 1f 00 01 01 00 87 65 43 21 00 60 00 00 ff ff ff ff 00 20 00 08 00 00 00 00 00 00 00 08 00 01 00 00 00 00 00 08 00 96 00 00 00 01 00 08 00 00 00 01 00 20 00 08 00 00 00 01 00 00 00 08 00 02 00 00 00 00 00 08 00 96 00 00 00 01 00 08 00 00 00 02 00 20 00 08 00 00 00 02 00 00 00 08 00 03 00 00 00 00 00 08 00 96 00 00 00 01 00 08 00 00 00 03 ff ff 00 28 00 00 15 40 00 00 00 01 00 00 00 00 68 61 73 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07"
+    if test X"$1" = X"OFPGC_MODIFY"; then shift;
+        echo >>expout2 "send: NXT_GROUP_MOD:
+ MOD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:150,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:150,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:150,watch_port:3,actions=output:3"
+        echo >>expout1 "NXT_REQUESTFORWARD: reason=group_mod
+ MOD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:150,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:150,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:150,watch_port:3,actions=output:3"
+        echo >>expout3 "NXT_REQUESTFORWARD: reason=group_mod
+ MOD group_id=2271560481,type=select,selection_method=hash,selection_method_param=7,bucket=bucket_id:0,weight:150,watch_port:1,actions=output:1,bucket=bucket_id:1,weight:150,watch_port:2,actions=output:2,bucket=bucket_id:2,weight:150,watch_port:3,actions=output:3"
+    fi
+
+    ovs-appctl -t `pwd`/c1 ofctl/barrier
+    echo >>expout1 "OFPT_BARRIER_REPLY:"
+    ovs-appctl -t `pwd`/c2 ofctl/barrier
+    echo >>expout2 "OFPT_BARRIER_REPLY:"
+    ovs-appctl -t `pwd`/c3 ofctl/barrier
+    echo >>expout3 "OFPT_BARRIER_REPLY:"
+
+    # Check output.
+    for i in 1 3; do
+        cp expout$i expout
+        AT_CHECK(
+      [[sed '
+s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
+      [0], [expout])
+    done
+}
+
+# controller 1: Become secondary
+# NXT_ROLE_REQUEST (xid=0x3): role=secondary
+ovs-appctl -t `pwd`/c1 ofctl/send 0104001400000003000023200000000a00000002
+
+# controller 2: Become primary
+# NXT_ROLE_REQUEST (xid=0x3): role=primary
+ovs-appctl -t `pwd`/c2 ofctl/send 0104001400000003000023200000000a00000001
+
+# controller 1: Become secondary
+# NXT_ROLE_REQUEST (xid=0x3): role=secondary
+ovs-appctl -t `pwd`/c3 ofctl/send 0104001400000003000023200000000a00000002
+
+# controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2
+ovs-appctl -t `pwd`/c1 ofctl/send 0104003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
+
+# controller 2: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2
+ovs-appctl -t `pwd`/c2 ofctl/send 0104003000000002000023200000001b000100080000000200030008000000050005000800000005000b000800000003
+
+# controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2
+ovs-appctl -t `pwd`/c3 ofctl/send 0104003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
+check_async 1 OFPGC_ADD OFPGC_MODIFY
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+dnl This test checks the Group and meter notifications when a group mod
+dnl command is sent from one controller and the reply is received by
+dnl other controllers, using the ONF Extension for OF 1.3.
+AT_SETUP([ofproto - ONF requestforward (OpenFlow 1.3)])
+OVS_VSWITCHD_START
+on_exit 'kill `cat c1.pid c2.pid c3.pid`'
+
+# Start two ovs-ofctl controller processes.
+AT_CAPTURE_FILE([monitor1.log])
+AT_CAPTURE_FILE([expout1])
+AT_CAPTURE_FILE([monitor2.log])
+AT_CAPTURE_FILE([expout2])
+AT_CAPTURE_FILE([monitor3.log])
+AT_CAPTURE_FILE([expout3])
+
+ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c1.pid --unixctl=c1
+ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c2.pid --unixctl=c2
+ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile=c3.pid --unixctl=c3
+
+check_async () {
+    for i in 1 3; do
+        ovs-appctl -t `pwd`/c$i ofctl/barrier
+        ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
+        : > expout$i
+    done
+
+    printf '\n\n--- check_async %d ---\n\n\n' $1
+    INDEX=$1
+    shift
+
+    # OFPGC_ADD
+    # OFPT_GROUP_MOD (OF1.3) (xid=0x2):
+    # ADD group_id=1,type=all,bucket=actions=drop
+    ovs-appctl -t `pwd`/c2 ofctl/send "040f0020000000020000000000000001 00100000 ffffffffffffffff 00000000"
+    if test X"$1" = X"OFPGC_ADD"; then shift;
+        echo >>expout2 "send: OFPT_GROUP_MOD (OF1.3):
+ ADD group_id=1,type=all,bucket=actions=drop"
+        echo >>expout1 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
+ ADD group_id=1,type=all,bucket=actions=drop"
+        echo >>expout3 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
+ ADD group_id=1,type=all,bucket=actions=drop"
+    fi
+
+    # OFPGC_MODIFY
+    # OFPT_GROUP_MOD (OF1.3) (xid=0x2):
+    # MOD group_id=1,type=select,bucket=weight:0,actions=drop
+    ovs-appctl -t `pwd`/c2 ofctl/send "040f0020000000020001010000000001 00100000 ffffffffffffffff 00000000"
+    if test X"$1" = X"OFPGC_MODIFY"; then shift;
+        echo >>expout2 "send: OFPT_GROUP_MOD (OF1.3):
+ MOD group_id=1,type=select,bucket=weight:0,actions=drop"
+        echo >>expout1 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
+ MOD group_id=1,type=select,bucket=weight:0,actions=drop"
+        echo >>expout3 "ONFT_REQUESTFORWARD (OF1.3): reason=group_mod
+ MOD group_id=1,type=select,bucket=weight:0,actions=drop"
+    fi
+
+    ovs-appctl -t `pwd`/c1 ofctl/barrier
+    echo >>expout1 "OFPT_BARRIER_REPLY (OF1.3):"
+    ovs-appctl -t `pwd`/c2 ofctl/barrier
+    echo >>expout2 "OFPT_BARRIER_REPLY (OF1.3):"
+    ovs-appctl -t `pwd`/c3 ofctl/barrier
+    echo >>expout3 "OFPT_BARRIER_REPLY (OF1.3):"
+
+    # Check output.
+    for i in 1 3; do
+        cp expout$i expout
+        AT_CHECK(
+      [[sed '
+s/ (xid=0x[0-9a-fA-F]*)//'< monitor$i.log]],
+      [0], [expout])
+    done
+}
+
+# controller 1: Become secondary
+# OFPT_ROLE_REQUEST (OF1.3) (xid=0x3): role=secondary
+ovs-appctl -t `pwd`/c1 ofctl/send 041800180000000300000003000000008000000000000002
+
+# controller 2: Become primary
+# OFPT_ROLE_REQUEST (OF1.3) (xid=0x3): role=primary
+ovs-appctl -t `pwd`/c2 ofctl/send 041800180000000300000002000000008000000000000003
+
+# controller 1: Become secondary
+# OFPT_ROLE_REQUEST (OF1.3) (xid=0x3): role=secondary
+ovs-appctl -t `pwd`/c3 ofctl/send 041800180000000300000003000000008000000000000004
+
+# controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2 (necessary for OF1.3)
+ovs-appctl -t `pwd`/c1 ofctl/send 0404003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
+
+# controller 2: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2 (necessary for OF1.3)
+ovs-appctl -t `pwd`/c2 ofctl/send 0404003000000002000023200000001b000100080000000200030008000000050005000800000005000b000800000003
+
+# controller 1: Enabled requestforward using OFPRAW_NXT_SET_ASYNC_CONFIG2 (necessary for OF1.3)
+ovs-appctl -t `pwd`/c3 ofctl/send 0404003000000002000023200000001b00000008000000050002000800000002000400080000001a000a000800000003
+check_async 1 OFPGC_ADD OFPGC_MODIFY
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+
+
 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
 dnl controllers despite the spec) as meaning a packet that was generated
@@ -4393,7 +4556,7 @@ m4_divert_push([PREPARE_TESTS])
 # past the nearest line that does not start with a space.
 [
 multiline_sort () {
-    $PYTHON -c '
+    $PYTHON3 -c '
 import sys
 
 buffer = []
@@ -4680,7 +4843,7 @@ ovs-appctl -t ovs-ofctl ofctl/block
 
 # Add $n_msgs flows.
 (echo "in_port=2,actions=output:2"
-$PYTHON -c '
+$PYTHON3 -c '
 for i in range('$n_msgs'):
     print("cookie=1,reg1=%d,actions=drop" % i)
 ') > flows.txt
@@ -4748,6 +4911,27 @@ NXT_FLOW_MONITOR_RESUMED:
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
+AT_SETUP([ofproto - flow monitoring usable protocols])
+AT_KEYWORDS([monitor])
+
+OVS_VSWITCHD_START
+
+on_exit 'kill `cat ovs-ofctl.pid`'
+ovs-ofctl -OOpenFlow14 monitor br0 watch:udp,udp_dst=8 --detach --no-chdir --pidfile >monitor.log 2>&1
+AT_CAPTURE_FILE([monitor.log])
+
+# ovs-ofctl should exit because monitor is not supported in OpenFlow 1.4
+OVS_WAIT_UNTIL([grep "ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM) is among the allowed flow formats (OXM-OpenFlow14)" monitor.log])
+
+# check that only NXM flag is returned as usable protocols for sctp_dst
+# and ovs-ofctl should exit since monitor is not supported in OpenFlow 1.4
+ovs-ofctl -OOpenFlow14 monitor br0 watch:sctp,sctp_dst=9 --detach --no-chdir --pidfile >monitor.log 2>&1
+OVS_WAIT_UNTIL([grep "ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OXM-OpenFlow14)" monitor.log])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+
 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
 AT_KEYWORDS([monitor])
 OVS_VSWITCHD_START
@@ -4767,7 +4951,7 @@ EOF
 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
 OFPT_GET_ASYNC_REPLY (OF1.3):
master:
primary:
        PACKET_IN: no_match action
      PORT_STATUS: add delete modify
     FLOW_REMOVED: idle hard delete group_delete
@@ -4775,7 +4959,7 @@ OFPT_GET_ASYNC_REPLY (OF1.3):
     TABLE_STATUS: (off)
   REQUESTFORWARD: (off)
 
- slave:
+ secondary:
        PACKET_IN: (off)
      PORT_STATUS: add delete modify
     FLOW_REMOVED: (off)
@@ -4794,11 +4978,11 @@ add_of_ports br0 1 2 3
 
 set_and_check_specific_ofports () {
     ovs-vsctl set Interface p1 ofport_request="$1" -- \
-             set Interface p2 ofport_request="$2" -- \
-             set Interface p3 ofport_request="$3"
+              set Interface p2 ofport_request="$2" -- \
+              set Interface p3 ofport_request="$3"
     ofports=`ovs-vsctl get Interface p1 ofport -- \
-                      get Interface p2 ofport -- \
-                      get Interface p3 ofport`
+                       get Interface p2 ofport -- \
+                       get Interface p3 ofport`
     AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
 ])
 }
@@ -4806,8 +4990,8 @@ for pre in      '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
     for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
         echo -----------------------------------------------------------
         echo "Check changing port numbers from $pre to $post"
-       set_and_check_specific_ofports $pre
-       set_and_check_specific_ofports $post
+        set_and_check_specific_ofports $pre
+        set_and_check_specific_ofports $post
     done
 done
 
@@ -4815,7 +4999,7 @@ ovs-vsctl del-port p3
 
 set_and_check_poorly_specified_ofports () {
     ovs-vsctl set Interface p1 ofport_request="$1" -- \
-             set Interface p2 ofport_request="$2"
+              set Interface p2 ofport_request="$2"
     p1=`ovs-vsctl get Interface p1 ofport`
     p2=`ovs-vsctl get Interface p2 ofport`
     echo $p1 $p2
@@ -4823,8 +5007,8 @@ set_and_check_poorly_specified_ofports () {
     AT_CHECK([test "$p1" != "$p2"])
     if test "$1" = "$2" && test "$1" != '[[]]'; then
         # One port number must be the requested one.
-       AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
-       # The other port number must be different (already tested above).
+        AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
+        # The other port number must be different (already tested above).
     else
         AT_CHECK([test "$1" = '[[]]' || test "$p1" = "$1"])
         AT_CHECK([test "$2" = '[[]]' || test "$p2" = "$2"])
@@ -5137,19 +5321,19 @@ dnl Check logs for OpenFlow trace
 # Prevent race.
 OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
 AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO:
  version bitmap: 0x01
-vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
+vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
  version bitmap: 0x05
-vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05)
+vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
  bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
@@ -5187,11 +5371,11 @@ vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
  bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
  bundle_id=0 type=COMMIT_REPLY flags=0
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO:
  version bitmap: 0x01
-vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
+vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
@@ -5199,11 +5383,11 @@ vconn|DBG|unix: received: NXST_FLOW request:
 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
  idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
  idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
  version bitmap: 0x05
-vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05)
+vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
  bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
@@ -5220,11 +5404,11 @@ vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
  bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
  bundle_id=0 type=COMMIT_REPLY flags=0
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO:
  version bitmap: 0x01
-vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
+vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
@@ -5232,11 +5416,11 @@ vconn|DBG|unix: received: NXST_FLOW request:
 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
  idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
  idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
  version bitmap: 0x05
-vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05)
+vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
  bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
@@ -5256,11 +5440,11 @@ vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
  bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
  bundle_id=0 type=COMMIT_REPLY flags=0
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO:
  version bitmap: 0x01
-vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
+vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
@@ -5390,6 +5574,135 @@ OFPT_BARRIER_REPLY (OF1.4):
 OVS_VSWITCHD_STOP
 AT_CLEANUP
 
+AT_SETUP([ofproto - bundle custom timeout (OpenFlow 1.4)])
+AT_KEYWORDS([monitor])
+OVS_VSWITCHD_START
+
+AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:bundle-idle-timeout=4])
+
+# Start a monitor, use the required protocol version
+ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
+AT_CAPTURE_FILE([monitor.log])
+
+ovs-appctl time/stop
+
+# Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (01)
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 01 00 00 00 01 00 00 00 03"
+ovs-appctl time/warp 2000
+# Send a bundle flow mod, it should keep the bundle alive.
+ovs-appctl -t ovs-ofctl ofctl/send "05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 03 \
+05 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \
+00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \
+ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \
+00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \
+50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \
+80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \
+00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \
+00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \
+00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \
+"
+ovs-appctl time/warp 2000
+# Send a bundle close, it should keep the bundle alive.
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 03 00 00 00 01 00 02 00 03"
+ovs-appctl time/warp 4000
+# Make sure that timeouts are processed after the expiry, but still before the
+# current timeout of 4s.
+ovs-appctl time/warp 1000
+# Send a Commit, but too late.
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 04 00 00 00 01 00 04 00 03"
+ovs-appctl -t ovs-ofctl ofctl/barrier
+OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
+
+AT_CHECK([ofctl_strip < monitor.log], [], [dnl
+send: OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=OPEN_REPLY flags=0
+send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
+ bundle_id=0x1 flags=atomic ordered
+OFPT_FLOW_MOD (OF1.4): ADD table:1 priority=65535,arp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 actions=output:3
+send: OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=CLOSE_REQUEST flags=atomic ordered
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=CLOSE_REPLY flags=0
+OFPT_ERROR (OF1.4): OFPBFC_TIMEOUT
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
+send: OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
+OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
+OFPT_BARRIER_REPLY (OF1.4):
+])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+AT_SETUP([ofproto - bundle reset timeout to default (OpenFlow 1.4)])
+AT_KEYWORDS([monitor])
+OVS_VSWITCHD_START
+
+AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:bundle-idle-timeout=15])
+AT_CHECK([ovs-vsctl remove Open_vSwitch . other_config bundle-idle-timeout])
+
+# Start a monitor, use the required protocol version
+ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
+AT_CAPTURE_FILE([monitor.log])
+
+ovs-appctl time/stop
+
+# Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (01)
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 01 00 00 00 01 00 00 00 03"
+ovs-appctl time/warp 8000
+# Send a bundle flow mod, it should keep the bundle alive.
+ovs-appctl -t ovs-ofctl ofctl/send "05 22 00 a0 00 00 00 02 00 00 00 01 00 00 00 03 \
+05 0e 00 90 00 00 00 02 00 00 00 00 00 00 00 00 \
+00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff \
+ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 \
+00 01 00 42 80 00 00 04 00 00 00 01 80 00 08 06 \
+50 54 00 00 00 06 80 00 06 06 50 54 00 00 00 05 \
+80 00 0a 02 08 06 80 00 0c 02 00 00 80 00 2a 02 \
+00 02 80 00 2c 04 c0 a8 00 02 80 00 2e 04 c0 a8 \
+00 01 00 00 00 00 00 00 00 04 00 18 00 00 00 00 \
+00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 00 \
+"
+ovs-appctl time/warp 8000
+# Send a bundle close, it should keep the bundle alive.
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 03 00 00 00 01 00 02 00 03"
+ovs-appctl time/warp 11000
+# Make sure that timeouts are processed after the expiry
+ovs-appctl time/warp 1000
+# Send a Commit, but too late.
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 04 00 00 00 01 00 04 00 03"
+ovs-appctl -t ovs-ofctl ofctl/barrier
+OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
+
+AT_CHECK([ofctl_strip < monitor.log], [], [dnl
+send: OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=OPEN_REPLY flags=0
+send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
+ bundle_id=0x1 flags=atomic ordered
+OFPT_FLOW_MOD (OF1.4): ADD table:1 priority=65535,arp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 actions=output:3
+send: OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=CLOSE_REQUEST flags=atomic ordered
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=CLOSE_REPLY flags=0
+OFPT_ERROR (OF1.4): OFPBFC_TIMEOUT
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=OPEN_REQUEST flags=atomic ordered
+send: OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
+OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REQUEST flags=atomic ordered
+OFPT_BARRIER_REPLY (OF1.4):
+])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
 
 AT_SETUP([ofproto - bundle open (OpenFlow 1.3)])
 AT_KEYWORDS([monitor])
@@ -5690,19 +6003,19 @@ dnl Check logs for OpenFlow trace
 # Prevent race.
 OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
 AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO:
  version bitmap: 0x01
-vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
+vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
  version bitmap: 0x04
-vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x07 and earlier, peer supports version 0x04)
+vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x06 and earlier, peer supports version 0x04)
 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
  bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
@@ -5740,11 +6053,11 @@ vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
  bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
  bundle_id=0 type=COMMIT_REPLY flags=0
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO:
  version bitmap: 0x01
-vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
+vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
@@ -5752,11 +6065,11 @@ vconn|DBG|unix: received: NXST_FLOW request:
 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
  idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
  idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
  version bitmap: 0x04
-vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x07 and earlier, peer supports version 0x04)
+vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x06 and earlier, peer supports version 0x04)
 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
  bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
@@ -5773,11 +6086,11 @@ vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
  bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
  bundle_id=0 type=COMMIT_REPLY flags=0
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO:
  version bitmap: 0x01
-vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
+vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
@@ -5785,11 +6098,11 @@ vconn|DBG|unix: received: NXST_FLOW request:
 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
  idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
  idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO (OF1.3):
  version bitmap: 0x04
-vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x07 and earlier, peer supports version 0x04)
+vconn|DBG|unix: negotiated OpenFlow version 0x04 (we support version 0x06 and earlier, peer supports version 0x04)
 vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
  bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
@@ -5809,11 +6122,11 @@ vconn|DBG|unix: received: ONFT_BUNDLE_CONTROL (OF1.3):
  bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
 vconn|DBG|unix: sent (Success): ONFT_BUNDLE_CONTROL (OF1.3):
  bundle_id=0 type=COMMIT_REPLY flags=0
-vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
- version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
+vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
+ version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
 vconn|DBG|unix: received: OFPT_HELLO:
  version bitmap: 0x01
-vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x07 and earlier, peer supports version 0x01)
+vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY: