From af40f5b908d69686beef9ddf16da94e5a79a8742 Mon Sep 17 00:00:00 2001 From: Joe Stringer Date: Tue, 11 Feb 2014 13:55:32 -0800 Subject: [PATCH] ofproto-dpif: Test flow stats reporting. 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 Signed-off-by: Ben Pfaff --- tests/ofproto-dpif.at | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 400fc31d7..ff9ead147 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -2191,6 +2191,27 @@ AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0 AT_CLEANUP +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' | sort], [0], [dnl + cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL + cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL +]) +OVS_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([idle_age and hard_age increase over time]) OVS_VSWITCHD_START -- 2.20.1