X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Fovs-vsctl.at;h=152a6585c0dcecccd92dad014e249520e102d0a9;hb=96fc46e8fdafd6467906e11e0fb493e2b78f2fb5;hp=72090d0207d7292b953170a6f3016ec72fd80ebb;hpb=31681a5d627cec70864764586829bdb92abf2f30;p=openvswitch diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at index 72090d02..152a6585 100644 --- a/tests/ovs-vsctl.at +++ b/tests/ovs-vsctl.at @@ -15,17 +15,17 @@ dnl RUN_OVS_VSCTL(COMMAND, ...) dnl dnl Executes each ovs-vsctl COMMAND. m4_define([RUN_OVS_VSCTL], - [m4_foreach([command], [$@], [ovs-vsctl --no-wait -vreconnect:ANY:emer --db=unix:socket -- command + [m4_foreach([command], [$@], [ovs-vsctl --timeout=5 --no-wait -vreconnect:ANY:emer --db=unix:socket -- command ])]) m4_define([RUN_OVS_VSCTL_ONELINE], - [m4_foreach([command], [$@], [ovs-vsctl --no-wait -vreconnect:ANY:emer --db=unix:socket --oneline -- command + [m4_foreach([command], [$@], [ovs-vsctl --timeout=5 --no-wait -vreconnect:ANY:emer --db=unix:socket --oneline -- command ])]) dnl RUN_OVS_VSCTL_TOGETHER(COMMAND, ...) dnl dnl Executes each ovs-vsctl COMMAND in a single run of ovs-vsctl. m4_define([RUN_OVS_VSCTL_TOGETHER], - [ovs-vsctl --no-wait -vreconnect:ANY:emer --db=unix:socket --oneline dnl + [ovs-vsctl --timeout=5 --no-wait -vreconnect:ANY:emer --db=unix:socket --oneline dnl m4_foreach([command], [$@], [ -- command])]) dnl CHECK_BRIDGES([BRIDGE, PARENT, VLAN], ...) @@ -584,6 +584,7 @@ active_timeout : 0 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])], @@ -704,6 +705,55 @@ AT_CHECK([cat stdout4], [0], [500 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.