X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Fofproto.at;fp=tests%2Fofproto.at;h=2ffe6530284df350981f401d0d7b0f05dc9f0ae6;hb=7d78f21c057ff50a823220d809ac38c3d907243c;hp=7838db7515d8e9953c57c36b329719214ce62d98;hpb=8d25251929c8f325bed0fff24192d5a87034b32e;p=sliver-openvswitch.git diff --git a/tests/ofproto.at b/tests/ofproto.at index 7838db751..2ffe65302 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -2154,6 +2154,9 @@ fi queue_size=`expr $rmem_max + 128 \* 1024` echo rmem_max=$rmem_max queue_size=$queue_size +# If there's too much queuing skip the test to avoid timing out. +AT_SKIP_IF([test $rmem_max -gt 1048576]) + # Each flow update message takes up at least 48 bytes of space in queues # and in practice more than that. n_msgs=`expr $queue_size / 48` @@ -2326,3 +2329,237 @@ for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \ done OVS_VSWITCHD_STOP AT_CLEANUP + + +AT_SETUP([ofproto - bundles, open (OpenFlow 1.4)]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +# Start a monitor, use the required protocol version +ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 +AT_CAPTURE_FILE([monitor.log]) + +# Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a) +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([ofctl_strip < monitor.log], [], [dnl +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REQUEST flags=atomic +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REPLY flags=0 +OFPT_BARRIER_REPLY (OF1.4): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto - bundles, double open (OpenFlow 1.4)]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +# Start a monitor, use the required protocol version +ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 +AT_CAPTURE_FILE([monitor.log]) + +# Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a) +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([ofctl_strip < monitor.log], [0], [dnl +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REQUEST flags=atomic +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REPLY flags=0 +OFPT_BARRIER_REPLY (OF1.4): +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REQUEST flags=atomic +OFPT_ERROR (OF1.4): OFPBFC_BAD_ID +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REQUEST flags=atomic +OFPT_BARRIER_REPLY (OF1.4): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +# Start a monitor, use the required protocol version +ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 +AT_CAPTURE_FILE([monitor.log]) + +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([ofctl_strip < monitor.log], [0], [dnl +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=CLOSE_REQUEST flags=atomic +OFPT_ERROR (OF1.4): OFPBFC_BAD_ID +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=CLOSE_REQUEST flags=atomic +OFPT_BARRIER_REPLY (OF1.4): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +# Start a monitor, use the required protocol version +ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 +AT_CAPTURE_FILE([monitor.log]) + +# Open, Close, Close +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([ofctl_strip < monitor.log], [0], [dnl +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REQUEST flags=atomic +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REPLY flags=0 +OFPT_BARRIER_REPLY (OF1.4): +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=CLOSE_REQUEST flags=atomic +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=CLOSE_REPLY flags=0 +OFPT_BARRIER_REPLY (OF1.4): +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=CLOSE_REQUEST flags=atomic +OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=CLOSE_REQUEST flags=atomic +OFPT_BARRIER_REPLY (OF1.4): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +# Start a monitor, use the required protocol version +ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 +AT_CAPTURE_FILE([monitor.log]) + +# Open, Close, Close +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([ofctl_strip < monitor.log], [0], [dnl +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REQUEST flags=atomic +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REPLY flags=0 +OFPT_BARRIER_REPLY (OF1.4): +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=CLOSE_REQUEST flags=ordered +OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=CLOSE_REQUEST flags=ordered +OFPT_BARRIER_REPLY (OF1.4): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +# Start a monitor, use the required protocol version +ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 +AT_CAPTURE_FILE([monitor.log]) + +# Open, Close, Close +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([ofctl_strip < monitor.log], [0], [dnl +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=COMMIT_REQUEST flags=atomic +OFPT_ERROR (OF1.4): OFPBFC_BAD_ID +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=COMMIT_REQUEST flags=atomic +OFPT_BARRIER_REPLY (OF1.4): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +# Start a monitor, use the required protocol version +ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 +AT_CAPTURE_FILE([monitor.log]) + +# Open, Close, Close +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([ofctl_strip < monitor.log], [0], [dnl +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REQUEST flags=atomic +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=OPEN_REPLY flags=0 +OFPT_BARRIER_REPLY (OF1.4): +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=COMMIT_REQUEST flags=ordered +OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=COMMIT_REQUEST flags=ordered +OFPT_BARRIER_REPLY (OF1.4): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP + +AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)]) +AT_KEYWORDS([monitor]) +OVS_VSWITCHD_START + +# Start a monitor, use the required protocol version +ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1 +AT_CAPTURE_FILE([monitor.log]) + +# Open, Close, Close +ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 01" +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([ofctl_strip < monitor.log], [0], [dnl +send: OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=DISCARD_REQUEST flags=atomic +OFPT_ERROR (OF1.4): OFPBFC_BAD_ID +OFPT_BUNDLE_CONTROL (OF1.4): + bundle_id=0x1 type=DISCARD_REQUEST flags=atomic +OFPT_BARRIER_REPLY (OF1.4): +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP