From 01dd0ab512e54dc1bf628833c7acd2ef090237a2 Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Mon, 28 Aug 2023 14:16:22 +0200 Subject: [PATCH] tests: Fix time dependency in overlapping flows modification test. 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: 21410ff800cc ("dpif-netdev: Fix dpif_netdev_flow_put.") Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2023-August/052623.html Reported-by: Sangeetha Elumalai Reviewed-by: Frode Nordahl Signed-off-by: Ilya Maximets --- tests/pmd.at | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/pmd.at b/tests/pmd.at index 7c333a901ba..7bdaca9e71f 100644 --- a/tests/pmd.at +++ b/tests/pmd.at @@ -1355,18 +1355,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 -])