AT_SETUP([external IDs])
AT_KEYWORDS([ovs-vsctl])
OVS_VSCTL_SETUP
-AT_CHECK([RUN_OVS_VSCTL_TOGETHER(
+AT_CHECK([RUN_OVS_VSCTL_ONELINE(
[add-br a],
[add-port a a1],
[add-bond a bond0 a2 a3],
OVS_VSCTL_CLEANUP
AT_CLEANUP
+AT_SETUP([--id option on create, get commands])
+AT_KEYWORDS([ovs-vsctl])
+OVS_VSCTL_SETUP
+AT_CHECK([RUN_OVS_VSCTL([add-br br0],
+ [add-port br0 eth0],
+ [add-port br0 eth1])])
+AT_CHECK(
+ [RUN_OVS_VSCTL_TOGETHER(
+ [set bridge br0 mirrors=@m],
+ [--id=@eth0 get port eth0],
+ [--id=@eth1 get port eth1],
+ [--id=@m create mirror name=mymirror select-dst-port=@eth0 select-src-port=@eth0 output-port=@eth1])],
+ [0], [stdout], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK(
+ [perl $srcdir/uuidfilt.pl stdout], [0], [dnl
+
+
+
+<0>
+],
+ [], [OVS_VSCTL_CLEANUP])
+AT_CHECK(
+ [RUN_OVS_VSCTL(
+ [list port eth0 eth1],
+ [list mirror],
+ [list bridge br0])],
+ [0], [stdout], [], [OVS_VSCTL_CLEANUP])
+AT_CHECK(
+ [sed -n -e '/uuid/p' -e '/name/p' -e '/mirrors/p' -e '/select/p' -e '/output/p' < stdout | $srcdir/uuidfilt.pl], [0], [dnl
+[_uuid : <0>
+name : "eth0"
+_uuid : <1>
+name : "eth1"
+_uuid : <2>
+name : mymirror
+output_port : <1>
+output_vlan : []
+select_all : false
+select_dst_port : [<0>]
+select_src_port : [<0>]
+select_vlan : []
+_uuid : <3>
+mirrors : [<2>]
+name : "br0"
+]],
+ [], [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.