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")
This commit is contained in:
Kristof Provost 2023-10-05 09:41:25 +02:00
parent 166a655fcf
commit 956a463114

View File

@ -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