[ovs-dev] [PATCH 1/5] ofproto-dpif: Test flow stats reporting.

Joe Stringer joestringer at nicira.com
Tue Feb 11 21:55:32 UTC 2014


Basic test to check that the datapath reports the correct number of
packets seen, after a delay of 1 second.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
---
 tests/ofproto-dpif.at |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 8dcd7b9..7c49093 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -2700,6 +2700,27 @@ m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
 CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1], [IPv4])
 CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]], [IPv6])
 
+AT_SETUP([ofproto-dpif - flow stats])
+OVS_VSWITCHD_START
+AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
+AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
+
+ovs-appctl time/stop
+
+for i in `seq 1 10`; do
+    ovs-appctl netdev-dummy/receive br0 'in_port(0),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)'
+done
+
+ovs-appctl time/warp 1000
+
+AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
+AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p'], [0], [dnl
+ cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
+ cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
+])
+OVS_VSWITCHD_STOP
+AT_CLEANUP
+
 AT_SETUP([idle_age and hard_age increase over time])
 OVS_VSWITCHD_START
 
-- 
1.7.9.5




More information about the dev mailing list