From: Jean Tourrilhes Date: Thu, 19 Jun 2014 01:05:44 +0000 (-0700) Subject: tests: Check that port status MODIFY messages are generated. X-Git-Tag: v2.4.0~1234 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=ebeae5db715dd4a33a6918765505b5695f938fce;p=cascardo%2Fovs.git tests: Check that port status MODIFY messages are generated. ONF-JIRA: EXT-338 Signed-off-by: Jean Tourrilhes --- diff --git a/tests/ofproto.at b/tests/ofproto.at index 8f4dd423f..382a09ea5 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -2021,6 +2021,79 @@ ovs-appctl -t ovs-ofctl exit OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)]) +OVS_VSWITCHD_START +AT_CHECK([ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile]) +check_async () { + printf '\n\n--- check_async %d ---\n\n\n' $1 + INDEX=$1 + shift + + ovs-appctl -t ovs-ofctl ofctl/barrier + ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log + : > expout + + # Other tests are not working with OF 1.5, and message + # format may change, so leave them out. + + # OFPT_PORT_STATUS, OFPPR_ADD + ovs-vsctl add-port br0 test -- set Interface test type=dummy + if test X"$1" = X"OFPPR_ADD"; then shift; + echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: PORT_DOWN + state: LINK_DOWN + speed: 0 Mbps now, 0 Mbps max" + fi + + # OFPT_PORT_STATUS, OFPPR_MODIFY + ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up + if test X"$1" = X"OFPPR_MODIFY"; then shift; + echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: 0 + state: LINK_DOWN + speed: 0 Mbps now, 0 Mbps max +OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x + config: 0 + state: 0 + speed: 0 Mbps now, 0 Mbps max" + fi + + # OFPT_PORT_STATUS, OFPPR_DELETE + ovs-vsctl del-port br0 test + if test X"$1" = X"OFPPR_DELETE"; then shift; + echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: 0 + state: 0 + speed: 0 Mbps now, 0 Mbps max" + fi + + AT_FAIL_IF([test X"$1" != X]) + + ovs-appctl -t ovs-ofctl ofctl/barrier + echo >>expout "OFPT_BARRIER_REPLY (OF1.5):" + + AT_CHECK( + [[sed ' +s/ (xid=0x[0-9a-fA-F]*)// +s/ *duration.*// +s/00:0.$/00:0x/' < monitor.log]], + [0], [expout]) +} + +# It's a service connection so initially there should be no async messages. +check_async 1 + +# If we don't set this, async messages are not received. +# Set miss_send_len to 128, turning on packet-ins for our service connection. +ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080 +check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE + +# Set-async has changed in OF 1.4 and is not yet implemented. + +ovs-appctl -t ovs-ofctl exit +OVS_VSWITCHD_STOP +AT_CLEANUP + dnl This test checks that the role request/response messaging works dnl and that generation_id is handled properly. AT_SETUP([ofproto - controller role (OpenFlow 1.2)])