AT_CHECK([RUN_OVS_VSCTL(
[add-br a],
[add-br b],
- [add-port a a1],
+ [add-port a a1 tag=9],
+ [get port a1 tag],
[--may-exist add-port b b1],
- [del-port a a1])], [0], [], [], [OVS_VSCTL_CLEANUP])
+ [del-port a a1])], [0], [9
+], [], [OVS_VSCTL_CLEANUP])
AT_CHECK([RUN_OVS_VSCTL([--may-exist add-port b b1])], [0], [], [],
[OVS_VSCTL_CLEANUP])
AT_CHECK([RUN_OVS_VSCTL([--may-exist add-port a b1])], [1], [],
OVS_VSCTL_SETUP
AT_CHECK([RUN_OVS_VSCTL_TOGETHER(
[add-br a],
- [add-bond a bond0 a1 a2 a3],
+ [add-bond a bond0 a1 a2 a3 tag=9],
+ [get Port bond0 tag],
[del-port bond0])], [0], [
+9
], [], [OVS_VSCTL_CLEANUP])
CHECK_BRIDGES([a, a, 0])
OVS_VSCTL_CLEANUP
AT_CLEANUP
+AT_SETUP([controllers])
+AT_KEYWORDS([controller ovs-vsctl])
+OVS_VSCTL_SETUP
+AT_CHECK([RUN_OVS_VSCTL_TOGETHER(
+ [add-br br0],
+
+ [get-controller br0],
+ [set-controller br0 tcp:4.5.6.7],
+ [get-controller br0],
+
+ [del-controller br0],
+ [get-controller br0],
+
+ [set-controller br0 tcp:8.9.10.11 tcp:5.4.3.2],
+ [get-controller br0])], [0], [
+
+
+tcp:4.5.6.7
+
+
+
+tcp:5.4.3.2\ntcp:8.9.10.11
+], [], [OVS_VSCTL_CLEANUP])
+OVS_VSCTL_CLEANUP
+AT_CLEANUP
+
dnl ----------------------------------------------------------------------
AT_BANNER([ovs-vsctl unit tests -- fake bridges])
AT_CHECK([RUN_OVS_VSCTL([create b name=br0])],
[0], [stdout], [], [OVS_VSCTL_CLEANUP])
cp stdout out1
-AT_CHECK([RUN_OVS_VSCTL([list b])],
+AT_CHECK([RUN_OVS_VSCTL([list b], [get b br0 _uuid])],
[0], [stdout], [], [OVS_VSCTL_CLEANUP])
cp stdout out2
AT_CHECK([perl $srcdir/uuidfilt.pl out1 out2], [0],
datapath_id : []
datapath_type : ""
external_ids : {}
+fail_mode : []
flood_vlans : []
mirrors : []
name : "br0"
other_config : {}
ports : []
sflow : []
+<0>
]], [ignore], [test ! -e pid || kill `cat pid`])
AT_CHECK(
[RUN_OVS_VSCTL(
add_id_to_interface : false
engine_id : []
engine_type : []
+external_ids : {}
targets : ["1.2.3.4:567"]
]], [ignore], [test ! -e pid || kill `cat pid`])
AT_CHECK([RUN_OVS_VSCTL([list interx x])],
AT_CHECK([RUN_OVS_VSCTL([list b x])],
[1], [], [ovs-vsctl: no row "x" in table Bridge
], [OVS_VSCTL_CLEANUP])
-AT_CHECK([RUN_OVS_VSCTL([list b br])],
- [1], [], [ovs-vsctl: multiple rows in Bridge match "br"
-], [OVS_VSCTL_CLEANUP])
AT_CHECK([RUN_OVS_VSCTL([get b br0 d])],
[1], [], [ovs-vsctl: Bridge contains more than one column whose name matches "d"
], [OVS_VSCTL_CLEANUP])
[1], [], [ovs-vsctl: :y=z: missing column name
], [OVS_VSCTL_CLEANUP])
AT_CHECK([RUN_OVS_VSCTL([get b br0 datapath_id:y=z])],
- [1], [], [ovs-vsctl: datapath_id:y=z: value not accepted here
+ [1], [], [ovs-vsctl: datapath_id:y=z: trailing garbage "=z" in argument
+], [OVS_VSCTL_CLEANUP])
+AT_CHECK([RUN_OVS_VSCTL([set b br0 'datapath_id:y>=z'])],
+ [1], [], [ovs-vsctl: datapath_id:y>=z: argument does not end in "=" followed by a value.
+], [OVS_VSCTL_CLEANUP])
+AT_CHECK([RUN_OVS_VSCTL([wait-until b br0 datapath_id:y,z])],
+ [1], [], [ovs-vsctl: datapath_id:y,z: argument does not end in "=", "!=", "<", ">", "<=", or ">=" followed by a value.
], [OVS_VSCTL_CLEANUP])
AT_CHECK([RUN_OVS_VSCTL([get b br0 datapath_id::])],
[1], [], [ovs-vsctl: datapath_id::: trailing garbage ":" in argument
[1], [], [ovs-vsctl: "add" operation would put 2 values in column datapath_id of table Bridge but the maximum number is 1
], [OVS_VSCTL_CLEANUP])
AT_CHECK([RUN_OVS_VSCTL([remove n `cat netflow-uuid` targets '"1.2.3.4:567"'])],
- [1], [], [ovs-vsctl: "remove" operation would put 0 values in column targets of table NetFlow but the minimun number is 1
+ [1], [], [ovs-vsctl: "remove" operation would put 0 values in column targets of table NetFlow but the minimum number is 1
], [OVS_VSCTL_CLEANUP])
AT_CHECK([RUN_OVS_VSCTL([clear n `cat netflow-uuid` targets])],
[1], [], [ovs-vsctl: "clear" operation cannot be applied to column targets of table NetFlow, which is not allowed to be empty
OVS_VSCTL_CLEANUP
AT_CLEANUP
+AT_SETUP([database commands -- wait-until immediately true])
+AT_KEYWORDS([ovs-vsctl])
+OVS_VSCTL_SETUP
+AT_CHECK([RUN_OVS_VSCTL(
+ [add-br br0],
+ [add-bond br0 bond0 eth0 eth1],
+ [set port bond0 bond_updelay=500 other-config:abc=def])],
+ [0], [], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK([RUN_OVS_VSCTL([[wait-until Open_vSwitch . managers=[]]])],
+ [0], [], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK([RUN_OVS_VSCTL([[wait-until Open_vSwitch . bridges!=[]]])],
+ [0], [], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK([RUN_OVS_VSCTL([[wait-until Port bond0 other-config:abc=def]])],
+ [0], [], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK([RUN_OVS_VSCTL([[wait-until port bond0 'bond_updelay>50' 'other-config:abc>d' 'other-config:abc<e']])],
+ [0], [], [], [OVS_VSCTL_CLEANUP])
+OVS_VSCTL_CLEANUP
+AT_CLEANUP
+
+AT_SETUP([database commands -- wait-until must wait])
+AT_KEYWORDS([ovs-vsctl])
+
+# Disable lcov for this test. All the programs running in parallel
+# race badly on access to profiling data.
+DISABLE_LCOV=true
+export DISABLE_LCOV
+
+OVS_VSCTL_SETUP
+
+# Start ovs-vsctls in background.
+(RUN_OVS_VSCTL([[wait-until o . bridges!=[] -- get bridge br10 other-config:abc]])) > stdout1 &
+(RUN_OVS_VSCTL([[wait-until bridge br1 -- get bridge br1 other-config:abc]])) > stdout2 &
+(RUN_OVS_VSCTL([[wait-until b br1 other-config={abc=def} -- get bridge br1 other-config]])) > stdout3 &
+(RUN_OVS_VSCTL([[wait-until port bond0 'bond_updelay>50' -- get port bond0 bond-updelay]])) > stdout4 &
+
+# Give the ovs-vsctls a chance to read the database
+sleep 1
+
+AT_CHECK([RUN_OVS_VSCTL([add-br br10 -- set bridge br10 other-config:abc=quux])
+RUN_OVS_VSCTL([add-br br1 -- set bridge br1 other-config:abc=def -- add-bond br1 bond0 eth0 eth1 -- set port bond0 bond_updelay=500])],
+ [0], [], [], [OVS_VSCTL_CLEANUP])
+
+# Wait for the ovs-vsctls to finish.
+wait
+
+# Check output
+AT_CHECK([cat stdout1], [0], [quux
+], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK([cat stdout2], [0], [def
+], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK([cat stdout3], [0], [{abc=def}
+], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK([cat stdout4], [0], [500
+], [], [OVS_VSCTL_CLEANUP])
+
+OVS_VSCTL_CLEANUP
+AT_CLEANUP
+
dnl This test really shows a bug -- "create" followed by "list" in
dnl the same execution shows the wrong UUID on the "list" command.
dnl The bug is documented in ovs-vsctl.8.
datapath_id : []
datapath_type : ""
external_ids : {}
+fail_mode : []
flood_vlans : []
mirrors : []
name : "br0"