X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fovs-ofctl.at;h=466ade6b510255a49b4e6e4b4ceebb0a9ad29fb5;hb=d534627818f126982e1d1aadf8919762de14d409;hp=111ed881ce846c2f411bcd625365448b55cdd79e;hpb=685a51a5b89750cead1b2934c2079d2bb9c52a4a;p=openvswitch diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 111ed881..466ade6b 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -464,3 +464,47 @@ nx_pull_match() returned error 44010101 nx_pull_match() returned error 44010101 ]) AT_CLEANUP + +dnl Check that "-F openflow10" rejects a flow_mod with a tun_id, since +dnl OpenFlow 1.0 doesn't support tunnels. +AT_SETUP([ovs-ofctl -F option and tun_id]) +AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop], + [1], [], [ovs-ofctl: flow cannot be expressed in flow format openflow10 (flow format tun_id_from_cookie or better is required) +]) +AT_CLEANUP + +dnl Check that "-F nxm" really forces add-flow to use the NXM flow format. +dnl (If it doesn't, then either the tun_id won't show up at all, or it will +dnl additionally show up as the top 32 bits of the cookie.) This checks +dnl for regression against bug #4566. +AT_SETUP([ovs-ofctl -F option with flow_mods]) +OFPROTO_START +AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop]) +AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS | STRIP_DURATION], [0], [dnl +NXST_FLOW reply: + cookie=0x0, duration=?s, table_id=0, n_packets=0, n_bytes=0, tun_id=0x12345678 actions=drop +]) +OFPROTO_STOP +AT_CLEANUP + +dnl Check that "-F openflow10" is really honored on dump-flows. +dnl (If it isn't, then dump-flows will show the register match.) +AT_SETUP([ovs-ofctl dump-flows honors -F option]) +OFPROTO_START +AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop]) +AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | STRIP_XIDS | STRIP_DURATION], [0], [dnl +OFPST_FLOW reply: + cookie=0x0, duration=?s, table_id=0, n_packets=0, n_bytes=0, actions=drop +]) +OFPROTO_STOP +AT_CLEANUP + +dnl Check that "-F openflow10" fails on dump-flows if the requested match +dnl can't be represented in OpenFlow 1.0. +AT_SETUP([ovs-ofctl dump-flows rejects bad -F option]) +OFPROTO_START +AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [], + [ovs-ofctl: unix:br0.mgmt: cannot use requested flow format nxm for specified flow +]) +OFPROTO_STOP +AT_CLEANUP