X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fofproto.at;h=84868d710241ba88ae22c44ac065bed472a9a3d4;hb=c57b22267be8fab0e504f3c246b9c154937933cb;hp=e21e4eb68291c1a322e9c125fad7d86f17113a58;hpb=b9718b7ba7828c702a67d5411f935b263bb9c795;p=openvswitch diff --git a/tests/ofproto.at b/tests/ofproto.at index e21e4eb6..84868d71 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -36,6 +36,21 @@ OFPST_PORT reply: 1 ports OVS_VSWITCHD_STOP AT_CLEANUP +dnl This is really bare-bones. +dnl It at least checks request and reply serialization and deserialization. +AT_SETUP([ofproto - port-desc stats]) +OVS_VSWITCHD_START +AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout]) +AT_CHECK([STRIP_XIDS stdout], [0], [dnl +OFPST_PORT_DESC reply: + LOCAL(br0): addr:aa:55:aa:55:00:00 + config: PORT_DOWN + state: LINK_DOWN + speed: 100 Mbps now, 100 Mbps max +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + dnl This is really bare-bones. dnl It at least checks request and reply serialization and deserialization. AT_SETUP([ofproto - queue stats]) @@ -214,12 +229,14 @@ OVS_VSWITCHD_START 0: classifier: wild=0x3fffff, max=1000000, active=0 lookup=0, matched=0" x=1 - while test $x -lt 255; do + while test $x -lt 254; do printf " %d: %-8s: wild=0x3fffff, max=1000000, active=0 lookup=0, matched=0 " $x table$x x=`expr $x + 1` - done) > expout + done + echo " 254: table254: wild=0x3fffff, max=1000000, active=2 + lookup=0, matched=0") > expout AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout]) # Change the configuration. AT_CHECK( @@ -499,7 +516,7 @@ s/00:0.$/00:0x/' < monitor.log]], # It's a service connection so initially there should be no async messages. check_async 1 -# Set miss_send_len to 128, turning on packet-outs for our service connection. +# Set miss_send_len to 128, turning on packet-ins for our service connection. ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE @@ -529,3 +546,36 @@ check_async 7 OFPR_ACTION OFPPR_ADD ovs-appctl -t ovs-ofctl exit OVS_VSWITCHD_STOP AT_CLEANUP + +dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as +dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some +dnl controllers despite the spec) as meaning a packet that was generated +dnl by the controller. +AT_SETUP([ofproto - packet-out from controller]) +OVS_VSWITCHD_START + +# Start a monitor listening for packet-ins. +AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile]) +ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080 +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log +AT_CAPTURE_FILE([monitor.log]) + +# Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port. +AT_CHECK([ovs-ofctl packet-out br0 none controller '0001020304050010203040501234']) +AT_CHECK([ovs-ofctl packet-out br0 65533 controller '0001020304050010203040505678']) + +# Stop the monitor and check its output. +ovs-appctl -t ovs-ofctl ofctl/barrier +ovs-appctl -t ovs-ofctl exit + +AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl +OFPT_PACKET_IN: total_len=14 in_port=NONE (via action) data_len=14 (unbuffered) +priority:0,tunnel:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0) +OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) +priority:0,tunnel:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:5678 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0) +OFPT_BARRIER_REPLY: +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP