Skip to content

Commit

Permalink
tests: Add test of double set-field in output action list.
Browse files Browse the repository at this point in the history
ONF-JIRA: EXT-314
Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
Jean Tourrilhes authored and blp committed Oct 8, 2014
1 parent 31c9ed6 commit 743c159
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/ofproto.at
Expand Up @@ -2381,6 +2381,34 @@ OFPT_BARRIER_REPLY (OF1.2):
OVS_VSWITCHD_STOP
AT_CLEANUP

dnl This test checks that metadata is encoded in packet_in structures,
dnl supported by NXAST.
AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)])
OVS_VSWITCHD_START

# Start a monitor listening for packet-ins.
AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
ovs-appctl -t ovs-ofctl ofctl/barrier
ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
AT_CAPTURE_FILE([monitor.log])

# Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234'])

# 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 (OF1.3): total_len=14 in_port=ANY metadata=0x6b (via action) data_len=14 (unbuffered)
in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
OFPT_BARRIER_REPLY (OF1.3):
])

OVS_VSWITCHD_STOP
AT_CLEANUP

dnl This test checks that tunnel metadata is encoded in packet_in structures.
AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
OVS_VSWITCHD_START
Expand Down

0 comments on commit 743c159

Please sign in to comment.