[ovs-dev] [PATCH] tests: Test reset_counts in flow_mod message

Tony van der Peet tony.vanderpeet at gmail.com
Tue Nov 29 00:22:41 UTC 2016


commit 23c753793204df86aa6eedd00ec62911a1ef9559
Author: Tony van der Peet <tony.vanderpeet at alliedtelesis.co.nz>
Date:   Tue Nov 29 13:16:17 2016 +1300

    tests: Test reset_counts in flow_mod message

    Setting the reset_counts flag in a flow_mod message should cause the
    flow counters to be reset. Test this by:

    - creating a flow
    - sending a single packet
    - modifying the flow with reset_counts flag set
    - dumping the flow and expecting n_packets=0, n_bytes=1

    This is assertion 140.80 of the ONF conformance test specification for
    v1.3.4.

diff --git a/tests/ofproto.at b/tests/ofproto.at
index d360b7a..1723e77 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -1648,6 +1648,19 @@ OFPST_FLOW reply (OF1.2):
 OVS_VSWITCHD_STOP
 AT_CLEANUP

+AT_SETUP([ofproto - mod flow with reset_counts flag - OF1.3])
+OVS_VSWITCHD_START
+add_of_ports br0 1 2 3
+AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 in_port=1,actions=2])
+ovs-appctl netdev-dummy/receive p1
'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)'
+AT_CHECK([ovs-ofctl -O openflow13 mod-flows br0
reset_counts,in_port=1,actions=3])
+AT_CHECK([ovs-ofctl -O openflow13 dump-flows br0 | ofctl_strip |
sort], [0], [dnl
+ in_port=1 actions=output:3
+OFPST_FLOW reply (OF1.3):
+])
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
 AT_SETUP([ofproto - del flows with cookies])
 OVS_VSWITCHD_START
 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])


More information about the dev mailing list