From 956a46311462423f97b2410065f8caff2c630701 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Thu, 5 Oct 2023 09:41:25 +0200 Subject: [PATCH] if_ovpn tests: fix ra test Client one is supposed to be assigend 198.51.100.2, but sometimes it loses the race and the address ends up assigned to client two. When this happened one would try to ping itself, which failed because the loopback interface isn't up. Ideally we'd generate static address assignments, but that would complicate the test. Activate loopback interfaces so the test always passes, and just try to ping both possible addresses. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/net/if_ovpn/if_ovpn.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh index c052a6d7eb47..bbaffa0bce73 100644 --- a/tests/sys/net/if_ovpn/if_ovpn.sh +++ b/tests/sys/net/if_ovpn/if_ovpn.sh @@ -805,14 +805,18 @@ ra_body() ifconfig ${bridge} addm ${two}a vnet_mkjail srv ${srv}b ${lan}a + jexec srv ifconfig lo0 inet 127.0.0.1/8 up jexec srv ifconfig ${srv}b 192.0.2.1/24 up jexec srv ifconfig ${lan}a 203.0.113.1/24 up vnet_mkjail lan ${lan}b + jexec lan ifconfig lo0 inet 127.0.0.1/8 up jexec lan ifconfig ${lan}b 203.0.113.2/24 up jexec lan route add default 203.0.113.1 vnet_mkjail one ${one}b + jexec one ifconfig lo0 inet 127.0.0.1/8 up jexec one ifconfig ${one}b 192.0.2.2/24 up vnet_mkjail two ${two}b + jexec two ifconfig lo0 inet 127.0.0.1/8 up jexec two ifconfig ${two}b 192.0.2.3/24 up # Sanity checks @@ -890,7 +894,9 @@ ra_body() # Client-to-client communication atf_check -s exit:0 -o ignore jexec one ping -c 1 198.51.100.3 + atf_check -s exit:0 -o ignore jexec one ping -c 1 198.51.100.2 atf_check -s exit:0 -o ignore jexec two ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore jexec two ping -c 1 198.51.100.3 # RA test atf_check -s exit:0 -o ignore jexec one ping -c 1 203.0.113.1