[ovs-dev] [PATCH RFC 5/5] ofproto.at: Add bundles tests for queuing and port_mod

Alexandru Copot alex.mihai.c at gmail.com
Tue May 6 18:28:31 UTC 2014


These tests verify that echo requests and barriers are
processed when bundles are open, while queuing other
messages for later processing.

The port_mod tests verify that changes to ports are correctly
reflected after applying bundles.

Signed-off-by: Alexandru Copot <alex.mihai.c at gmail.com>
Cc: Daniel Baluta <dbaluta at ixiacom.com>
---
 tests/ofproto.at | 323 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 323 insertions(+)

diff --git a/tests/ofproto.at b/tests/ofproto.at
index 2ffe653..53c7b00 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -2563,3 +2563,326 @@ OFPT_BARRIER_REPLY (OF1.4):
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP
+
+AT_SETUP([ofproto - bundle, don't queue echo, barrier (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 bundle.
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
+
+# Barriers should be allowed.
+ovs-appctl -t ovs-ofctl ofctl/barrier
+
+# Echo request. Must not be queued.
+ovs-appctl -t ovs-ofctl ofctl/send  "05 02 00 10 00 00 00 0a 01 02 03 04 05 06 07 08"
+
+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_ECHO_REQUEST (OF1.4): 8 bytes of payload
+OFPT_ECHO_REPLY (OF1.4): 8 bytes of payload
+00000000  01 02 03 04 05 06 07 08-                        |........        |
+OFPT_BARRIER_REPLY (OF1.4):
+])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+AT_SETUP([ofproto - bundle message queueing  (OpenFlow 1.4)])
+AT_KEYWORDS([monitor])
+OVS_VSWITCHD_START
+
+# Start a monitor, use the required protocol version
+ovs-ofctl -O OpenFlow13,OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
+AT_CAPTURE_FILE([monitor.log])
+
+# Open bundle.
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
+
+# Barriers should be allowed.
+ovs-appctl -t ovs-ofctl ofctl/barrier
+
+# Send get async config. Should be queued.
+ovs-appctl -t ovs-ofctl ofctl/send  "05 1a 00 08 00 00 00 0a"
+ovs-appctl -t ovs-ofctl ofctl/barrier
+
+# Commit
+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=OPEN_REQUEST flags=atomic
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=OPEN_REPLY flags=0
+OFPT_BARRIER_REPLY (OF1.4):
+send: OFPT_GET_ASYNC_REQUEST (OF1.4):
+OFPT_BARRIER_REPLY (OF1.4):
+send: OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REPLY flags=0
+OFPT_GET_ASYNC_REPLY (OF1.4):
+ master:
+       PACKET_IN: no_match action
+     PORT_STATUS: add delete modify
+    FLOW_REMOVED: idle hard delete
+
+ slave:
+       PACKET_IN: (off)
+     PORT_STATUS: add delete modify
+    FLOW_REMOVED: (off)
+OFPT_BARRIER_REPLY (OF1.4):
+])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+
+AT_SETUP([ofproto - bundle, port_mod commit  (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 bundle.
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
+
+# Barriers should be allowed.
+ovs-appctl -t ovs-ofctl ofctl/barrier
+
+# Add port_mod for local port, set port down
+ovs-appctl -t ovs-ofctl ofctl/send  "05 22 00 38 00 00 00 0a 00 00 00 01 00 00 00 00 \
+                                     05 10 00 28 00 00 00 0b ff ff ff fe 00 00 00 00 \
+                                     aa 55 aa 55 00 00 \
+                                     00 00 \
+                                     00 00 00 01 \
+                                     ff ff ff ff \
+                                     00 00 00 00 \
+                                     00 00 00 00"
+ovs-appctl -t ovs-ofctl ofctl/barrier
+
+# Commit
+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=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_ADD_MESSAGE (OF1.4):
+ bundle_id=0x1 flags=0
+OFPT_PORT_MOD (OF1.4):port: LOCAL: addr:aa:55:aa:55:00:00
+     config: PORT_DOWN
+     mask:   PORT_DOWN NO_RECV NO_FWD NO_PACKET_IN
+     advertise: UNCHANGED
+OFPT_BARRIER_REPLY (OF1.4):
+send: OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REPLY flags=0
+OFPT_BARRIER_REPLY (OF1.4):
+])
+
+AT_CHECK([ovs-ofctl show br0], [0], [dnl
+OFPT_FEATURES_REPLY (xid=0x2): dpid:fedcba9876543210
+n_tables:254, n_buffers:256
+capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
+actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
+ LOCAL(br0): addr:aa:55:aa:55:00:00
+     config:     PORT_DOWN
+     state:      LINK_DOWN
+     speed: 0 Mbps now, 0 Mbps max
+OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0
+])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+
+AT_SETUP([ofproto - bundle, port_mod with advertise commit  (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 bundle.
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
+
+# Barriers should be allowed.
+ovs-appctl -t ovs-ofctl ofctl/barrier
+
+# Add port_mod for local port, set port down
+ovs-appctl -t ovs-ofctl ofctl/send  "05 22 00 38 00 00 00 0a 00 00 00 01 00 00 00 00 \
+                                     05 10 00 28 00 00 00 0b ff ff ff fe 00 00 00 00 \
+                                     aa 55 aa 55 00 00 \
+                                     00 00 \
+                                     00 00 00 00 \
+                                     00 00 00 00 \
+                                     00 00 00 02 \
+                                     00 00 00 00"
+ovs-appctl -t ovs-ofctl ofctl/barrier
+
+# Commit
+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=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_ADD_MESSAGE (OF1.4):
+ bundle_id=0x1 flags=0
+OFPT_PORT_MOD (OF1.4):port: LOCAL: addr:aa:55:aa:55:00:00
+     config: 0
+     mask:   0
+     advertise: 10MB-FD
+OFPT_BARRIER_REPLY (OF1.4):
+send: OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REPLY flags=0
+OFPT_BARRIER_REPLY (OF1.4):
+])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
+AT_SETUP([ofproto - bundle, multiple port_mod commit  (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 bundle.
+ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
+
+# Barriers should be allowed.
+ovs-appctl -t ovs-ofctl ofctl/barrier
+
+# Add port_mod for local port, set port down
+ovs-appctl -t ovs-ofctl ofctl/send  "05 22 00 38 00 00 00 0a 00 00 00 01 00 00 00 00 \
+                                     05 10 00 28 00 00 00 0b ff ff ff fe 00 00 00 00 \
+                                     aa 55 aa 55 00 00 \
+                                     00 00 \
+                                     00 00 00 01 \
+                                     ff ff ff ff \
+                                     00 00 00 00 \
+                                     00 00 00 00"
+
+# Add port_mod for local port, set no_recv
+ovs-appctl -t ovs-ofctl ofctl/send  "05 22 00 38 00 00 00 0a 00 00 00 01 00 00 00 00 \
+                                     05 10 00 28 00 00 00 0b ff ff ff fe 00 00 00 00 \
+                                     aa 55 aa 55 00 00 \
+                                     00 00 \
+                                     00 00 00 04 \
+                                     ff ff ff ff \
+                                     00 00 00 00 \
+                                     00 00 00 00"
+
+# Add port_mod for local port, set no_fwd
+ovs-appctl -t ovs-ofctl ofctl/send  "05 22 00 38 00 00 00 0a 00 00 00 01 00 00 00 00 \
+                                     05 10 00 28 00 00 00 0b ff ff ff fe 00 00 00 00 \
+                                     aa 55 aa 55 00 00 \
+                                     00 00 \
+                                     00 00 00 20 \
+                                     ff ff ff f0 \
+                                     00 00 00 00 \
+                                     00 00 00 00"
+
+# Add port_mod for local port, set no_packet_in
+ovs-appctl -t ovs-ofctl ofctl/send  "05 22 00 38 00 00 00 0a 00 00 00 01 00 00 00 00 \
+                                     05 10 00 28 00 00 00 0b ff ff ff fe 00 00 00 00 \
+                                     aa 55 aa 55 00 00 \
+                                     00 00 \
+                                     00 00 00 40 \
+                                     ff ff ff f0 \
+                                     00 00 00 00 \
+                                     00 00 00 00"
+ovs-appctl -t ovs-ofctl ofctl/barrier
+
+# Commit
+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=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_ADD_MESSAGE (OF1.4):
+ bundle_id=0x1 flags=0
+OFPT_PORT_MOD (OF1.4):port: LOCAL: addr:aa:55:aa:55:00:00
+     config: PORT_DOWN
+     mask:   PORT_DOWN NO_RECV NO_FWD NO_PACKET_IN
+     advertise: UNCHANGED
+send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
+ bundle_id=0x1 flags=0
+OFPT_PORT_MOD (OF1.4):port: LOCAL: addr:aa:55:aa:55:00:00
+     config: NO_RECV
+     mask:   PORT_DOWN NO_RECV NO_FWD NO_PACKET_IN
+     advertise: UNCHANGED
+send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
+ bundle_id=0x1 flags=0
+OFPT_PORT_MOD (OF1.4):port: LOCAL: addr:aa:55:aa:55:00:00
+     config: NO_FWD
+     mask:   NO_FWD NO_PACKET_IN
+     advertise: UNCHANGED
+send: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
+ bundle_id=0x1 flags=0
+OFPT_PORT_MOD (OF1.4):port: LOCAL: addr:aa:55:aa:55:00:00
+     config: NO_PACKET_IN
+     mask:   NO_FWD NO_PACKET_IN
+     advertise: UNCHANGED
+OFPT_BARRIER_REPLY (OF1.4):
+send: OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
+OFPT_BUNDLE_CONTROL (OF1.4):
+ bundle_id=0x1 type=COMMIT_REPLY flags=0
+OFPT_BARRIER_REPLY (OF1.4):
+])
+
+AT_CHECK([ovs-ofctl show br0], [0], [dnl
+OFPT_FEATURES_REPLY (xid=0x2): dpid:fedcba9876543210
+n_tables:254, n_buffers:256
+capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
+actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
+ LOCAL(br0): addr:aa:55:aa:55:00:00
+     config:     NO_RECV NO_PACKET_IN
+     state:      0
+     speed: 0 Mbps now, 0 Mbps max
+OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0
+])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
-- 
1.9.2




More information about the dev mailing list