X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fovs-vsctl.at;h=326d5a4ffd792988286b7a35cd1df91d22d75a77;hb=ea7655d9f9d38a3af7250de8ba0b89115b5f4a5e;hp=84cc272d706e918e315a494613054795e22a563f;hpb=8706009e555bb9fa04a5679e4be2c7c67506802b;p=sliver-openvswitch.git diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at index 84cc272d7..326d5a4ff 100644 --- a/tests/ovs-vsctl.at +++ b/tests/ovs-vsctl.at @@ -15,7 +15,7 @@ dnl RUN_OVS_VSCTL(COMMAND, ...) dnl dnl Executes each ovs-vsctl COMMAND. m4_define([RUN_OVS_VSCTL], - [m4_foreach([command], [$@], [ovs-vsctl --timeout=5 --no-wait -vreconnect:emer --db=unix:socket -- command + [m4_foreach([command], [$@], [ovs-vsctl --timeout=5 --no-wait -vreconnect:emer --db=unix:socket command ])]) m4_define([RUN_OVS_VSCTL_ONELINE], [m4_foreach([command], [$@], [ovs-vsctl --timeout=5 --no-wait -vreconnect:emer --db=unix:socket --oneline -- command @@ -378,7 +378,7 @@ AT_SETUP([controllers]) AT_KEYWORDS([controller ovs-vsctl]) OVS_VSCTL_SETUP AT_CHECK([RUN_OVS_VSCTL_TOGETHER( - [add-br br0], + [add-br br0], [get-controller br0], [set-controller br0 tcp:4.5.6.7], @@ -439,6 +439,22 @@ CHECK_IFACES([xapi1], [eth0.$1]) OVS_VSCTL_CLEANUP AT_CLEANUP +AT_SETUP([list bridges -- real and fake (VLAN $1)]) +AT_KEYWORDS([ovs-vsctl fake-bridge]) +OVS_VSCTL_SETUP +OVS_VSCTL_SETUP_SIMPLE_FAKE_CONF([$1]) +AT_CHECK([RUN_OVS_VSCTL_ONELINE([-- list-br])], [0], + [xapi1\nxenbr0 +], [], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL_ONELINE([-- --real list-br])], [0], + [xenbr0 +], [], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL_ONELINE([-- --fake list-br])], [0], + [xapi1 +], [], [OVS_VSCTL_CLEANUP]) +OVS_VSCTL_CLEANUP +AT_CLEANUP + AT_SETUP([simple fake bridge + del-br fake bridge (VLAN $1)]) AT_KEYWORDS([ovs-vsctl fake-bridge]) OVS_VSCTL_SETUP @@ -568,7 +584,7 @@ AT_CHECK( [set o . bridges=@br0])], [0], [stdout], [], [OVS_VSCTL_CLEANUP]) cp stdout out1 -AT_CHECK([RUN_OVS_VSCTL([list b], [get b br0 _uuid])], +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], @@ -587,6 +603,7 @@ name : "br0" netflow : [] other_config : {} ports : [] +protocols : [] sflow : [] status : {} stp_enable : false @@ -624,12 +641,12 @@ AT_CHECK( 'other_config:datapath_id="0123456789ab"' \ 'other_config:hwaddr="00:11:22:33:44:55"' \ 'external-ids={"uuids"="9c45f225-a7cf-439d-976d-83db6271fda1"}' -- \ - add bridge br0 external_ids '"roles"="local; remote; cloud"'])], + add bridge br0 external_ids '"roles"="local; remote; cloud"'])], [0], [], [], [OVS_VSCTL_CLEANUP]) -AT_CHECK([RUN_OVS_VSCTL_ONELINE([get bridge br0 other_config external-ids])], +AT_CHECK([RUN_OVS_VSCTL_ONELINE([get bridge br0 other_config external-ids])], [0], [{datapath_id="0123456789ab", hwaddr="00:11:22:33:44:55"}\n{roles="local; remote; cloud", uuids="9c45f225-a7cf-439d-976d-83db6271fda1"} ], [], [OVS_VSCTL_CLEANUP]) -AT_CHECK([RUN_OVS_VSCTL([get bridge br0 other_config:hwaddr -- --if-exists get bridge br0 other-config:nonexistent])], +AT_CHECK([RUN_OVS_VSCTL([get bridge br0 other_config:hwaddr -- --if-exists get bridge br0 other-config:nonexistent])], [0], ["00:11:22:33:44:55" ], [], [OVS_VSCTL_CLEANUP]) @@ -649,12 +666,35 @@ AT_CHECK([RUN_OVS_VSCTL_TOGETHER([destroy b br0], [0], [stdout], [], [OVS_VSCTL_CLEANUP]) AT_CHECK([RUN_OVS_VSCTL([list b])], [0], [], [], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL([--if-exists get b x datapath_id])], + [0], [], [], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL([--if-exists list b x])], + [0], [], [], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL([--if-exists set controller x connection_mode=standalone])], + [0], [], [], [OVS_VSCTL_CLEANUP]) +AT_CHECK( + [RUN_OVS_VSCTL([--if-exists remove netflow x targets '"1.2.3.4:567"'])], + [0], [], [], [OVS_VSCTL_CLEANUP]) +AT_CHECK( + [RUN_OVS_VSCTL([--if-exists clear netflow x targets])], + [0], [], [], [OVS_VSCTL_CLEANUP]) OVS_VSCTL_CLEANUP AT_CLEANUP AT_SETUP([database commands -- negative checks]) AT_KEYWORDS([ovs-vsctl]) OVS_VSCTL_SETUP + +AT_CHECK([ovs-vsctl --may-exist], + [1], [ignore], [ovs-vsctl: missing command name (use --help for help) +], [OVS_VSCTL_CLEANUP]) +AT_CHECK([ovs-vsctl --may-exist --], + [1], [ignore], [ovs-vsctl: missing command name (use --help for help) +], [OVS_VSCTL_CLEANUP]) +AT_CHECK([ovs-vsctl -- --may-exist], + [1], [ignore], [ovs-vsctl: missing command name (use --help for help) +], [OVS_VSCTL_CLEANUP]) + AT_CHECK([RUN_OVS_VSCTL([add-br br0])], [0], [ignore], [], [OVS_VSCTL_CLEANUP]) AT_CHECK([RUN_OVS_VSCTL([add-br br1])], @@ -685,6 +725,9 @@ 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([get b x datapath_id])], + [1], [], [ovs-vsctl: no row "x" in table Bridge +], [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]) @@ -700,6 +743,9 @@ AT_CHECK([RUN_OVS_VSCTL([get b br0 datapath_id:y=z])], 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([set controller x connection_mode=standalone])], + [1], [], [ovs-vsctl: no row "x" in table Controller +], [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]) @@ -730,12 +776,30 @@ AT_CHECK([RUN_OVS_VSCTL([add b br1 datapath_id x y])], AT_CHECK([RUN_OVS_VSCTL([remove netflow `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 minimum number is 1 ], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL([remove netflow x targets '"1.2.3.4:567"'])], + [1], [], [ovs-vsctl: no row "x" in table NetFlow +], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL([clear netflow x targets])], + [1], [], [ovs-vsctl: no row "x" in table NetFlow +], [OVS_VSCTL_CLEANUP]) AT_CHECK([RUN_OVS_VSCTL([clear netflow `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_CHECK([RUN_OVS_VSCTL([destroy b br2])], [1], [], [ovs-vsctl: no row "br2" in table Bridge ], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL([add i br1 name x])], + [1], [], [ovs-vsctl: cannot modify read-only column name in table Interface +], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL([set port br1 name br2])], + [1], [], [ovs-vsctl: cannot modify read-only column name in table Port +], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL([remove b br1 name br1])], + [1], [], [ovs-vsctl: cannot modify read-only column name in table Bridge +], [OVS_VSCTL_CLEANUP]) +AT_CHECK([RUN_OVS_VSCTL([clear b br1 name])], + [1], [], [ovs-vsctl: cannot modify read-only column name in table Bridge +], [OVS_VSCTL_CLEANUP]) OVS_VSCTL_CLEANUP AT_CLEANUP @@ -1030,6 +1094,7 @@ name : "br0" netflow : [] other_config : {} ports : [] +protocols : [] sflow : [] status : {} stp_enable : false