Skip to content

Commit 93ec294

Browse files
igsilyaalmusil
authored andcommitted
tests: system-ovn: Fix force SNAT IP in load-balancer template test.
For some reason the forced SNAT IP in this test is configured as a random IP from the join switch subnet that doesn't belong to anything. When the return traffic hits the router R1, it doesn't know the destination MAC for this IP and the packet gets sent to ovn-controller and eventually dropped. None of the wget calls actually succeed. The test doesn't check that and it only checks that there are some conntrack entries, which are actually in SYN_SENT state. While this is enough to check that load balancing is happening, this makes the test extremely slow. wget is configured to re-try 5 times with 1 second wait. And it also by default backs off by 1 more second on every re-try. And we're calling wget 10 times. In the end, all of this takes 2.5 minutes per test. Test suite runs the test twice with different options resulting in 5 minutes of wasted time. Let's use the proper router IP instead for SNAT. This allows reply traffic to actually go through and wget to succeed, saving us these 5 minutes. Also changing the simple NS_EXEC to NS_CHECK_EXEC so the test fails if wget fails. The test still reproduces the original issue. Fixes: da55294 ("northd: Do not drop ip traffic with destination vip expressed via template vars.") Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Ales Musil <amusil@redhat.com>
1 parent 8eccb22 commit 93ec294

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tests/system-ovn.at

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17725,7 +17725,7 @@ ADD_VETH(bar1, bar1, br-int, "192.168.2.2/24", "f0:00:00:01:02:05", \
1772517725
check ovn-nbctl lsp-add bar bar1 \
1772617726
-- lsp-set-addresses bar1 "f0:00:00:01:02:05 192.168.2.2"
1772717727

17728-
check ovn-nbctl set logical_router R2 options:lb_force_snat_ip="20.0.0.5"
17728+
check ovn-nbctl set logical_router R2 options:lb_force_snat_ip="20.0.0.2"
1772917729

1773017730
AT_CHECK([ovn-nbctl -- create chassis_template_var chassis="hv1" \
1773117731
variables="{vip=172.16.1.1,vport1=8000,backends1=\"192.168.1.2:80,192.168.2.2:80\"}"],
@@ -17741,12 +17741,12 @@ check ovn-nbctl --wait=hv sync
1774117741
OVS_START_L7([foo1], [http])
1774217742
OVS_START_L7([bar1], [http])
1774317743

17744-
NETNS_START_TCPDUMP([foo1], [-neei foo1 src 20.0.0.5 and tcp], [foo1])
17745-
NETNS_START_TCPDUMP([bar1], [-neei bar1 src 20.0.0.5 and tcp], [bar1])
17744+
NETNS_START_TCPDUMP([foo1], [-neei foo1 src 20.0.0.2 and tcp], [foo1])
17745+
NETNS_START_TCPDUMP([bar1], [-neei bar1 src 20.0.0.2 and tcp], [bar1])
1774617746

1774717747
check ovs-appctl dpctl/flush-conntrack
1774817748
for i in $(seq 10); do
17749-
NS_EXEC([alice1], [wget 172.16.1.1:8000 -t 5 -T 1 --retry-connrefused -v -o wget$i.log])
17749+
NS_CHECK_EXEC([alice1], [wget 172.16.1.1:8000 -t 5 -T 1 --retry-connrefused -v -o wget$i.log])
1775017750
done
1775117751

1775217752
OVS_WAIT_UNTIL([
@@ -17758,10 +17758,10 @@ OVS_WAIT_UNTIL([
1775817758
test "${n_pkt}" -ge 1
1775917759
])
1776017760

17761-
AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(20.0.0.5) | \
17761+
AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(20.0.0.2) | \
1776217762
sed -e 's/zone=[[0-9]]*/zone=<cleared>/'], [0], [dnl
17763-
tcp,orig=(src=172.16.1.2,dst=192.168.1.2,sport=<cleared>,dport=<cleared>),reply=(src=192.168.1.2,dst=20.0.0.5,sport=<cleared>,dport=<cleared>),zone=<cleared>,protoinfo=(state=<cleared>)
17764-
tcp,orig=(src=172.16.1.2,dst=192.168.2.2,sport=<cleared>,dport=<cleared>),reply=(src=192.168.2.2,dst=20.0.0.5,sport=<cleared>,dport=<cleared>),zone=<cleared>,protoinfo=(state=<cleared>)
17763+
tcp,orig=(src=172.16.1.2,dst=192.168.1.2,sport=<cleared>,dport=<cleared>),reply=(src=192.168.1.2,dst=20.0.0.2,sport=<cleared>,dport=<cleared>),zone=<cleared>,protoinfo=(state=<cleared>)
17764+
tcp,orig=(src=172.16.1.2,dst=192.168.2.2,sport=<cleared>,dport=<cleared>),reply=(src=192.168.2.2,dst=20.0.0.2,sport=<cleared>,dport=<cleared>),zone=<cleared>,protoinfo=(state=<cleared>)
1776517765
])
1776617766

1776717767
OVN_CLEANUP_CONTROLLER([hv1])

0 commit comments

Comments
 (0)