Skip to content

Commit

Permalink
tests: Fix time dependency in overlapping flows modification test.
Browse files Browse the repository at this point in the history
On slow systems or at high testsuite concurrency sending 256 packets
can take more than 10 seconds.  This is causing expiration of one of
the flows and a subsequent test failure.

Use time warping instead to avoid the time dependency.

Fixes: 21410ff ("dpif-netdev: Fix dpif_netdev_flow_put.")
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2023-August/052623.html
Reported-by: Sangeetha Elumalai <[email protected]>
Reviewed-by: Frode Nordahl <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
igsilya committed Aug 28, 2023
1 parent 123b7aa commit bd95fe3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/pmd.at
Original file line number Diff line number Diff line change
Expand Up @@ -1217,18 +1217,22 @@ AT_CHECK([echo 'table=0,in_port=p1,ip,nw_dst=10.1.0.0/16 actions=ct(commit)' | d
ovs-ofctl --bundle replace-flows br0 -])
AT_CHECK([ovs-appctl revalidator/wait])

dnl Prevent flows from expiring.
AT_CHECK([ovs-appctl time/stop])

AT_CHECK([ovs-appctl netdev-dummy/receive p1 'ipv4(src=10.0.0.1,dst=10.1.0.2,proto=6),tcp(src=1,dst=2)'])
OVS_WAIT_UNTIL_EQUAL([ovs-appctl dpctl/dump-flows | sed 's/.*core: [[0-9]]*//' | strip_xout_keep_actions], [
recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=10.1.0.2/255.255.0.0,frag=no), packets:0, bytes:0, used:never, actions:ct(commit)
recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=10.1.2.2/255.255.255.0,frag=no), packets:0, bytes:0, used:0.0s, actions:ct(commit)])

dnl Hold the prefix 10.1.2.2/24 by another 10s.
AT_CHECK([ovs-appctl netdev-dummy/receive p1 'ipv4(src=10.0.0.1,dst=10.1.2.2,proto=6),tcp(src=1,dst=2)'])
dnl Send more 10.1.0.2 to make 10.1.0.0/16 tuple prepend 10.1.2.0/24 tuple in the pvector of subtables.
for i in $(seq 0 256); do
AT_CHECK([ovs-appctl netdev-dummy/receive p1 'ipv4(src=10.0.0.1,dst=10.1.0.2,proto=6),tcp(src=1,dst=2)'])
done

dnl Warp time enough to trigger subtable optimization.
AT_CHECK([ovs-appctl time/warp 500 2000], [0], [ignore])

AT_CHECK([echo 'table=0,in_port=p1,ip,nw_dst=10.1.0.0/16 actions=p2' | dnl
ovs-ofctl --bundle replace-flows br0 -])

Expand Down

0 comments on commit bd95fe3

Please sign in to comment.