diff options
author | Kristof Provost <kp@FreeBSD.org> | 2022-10-17 16:28:23 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2022-10-18 08:12:23 +0000 |
commit | 713efe0542975362cbde9c07479ac8bdd4cb8803 (patch) | |
tree | c3543d417845c9ba9142444c25ce1f33b0950618 /tests/sys | |
parent | 188e0696705fecd6f063b41b61b7dc4b6a3b0343 (diff) | |
download | src-713efe0542975362cbde9c07479ac8bdd4cb8803.tar.gz src-713efe0542975362cbde9c07479ac8bdd4cb8803.zip |
if_ovpn tests: fix timeout test case
Use the management interface to work out if we've timed out the client,
rather than looking for an openvpn process to die (with incorrect
syntax).
Sponsored by: Rubicon Communications, LLC ("Netgate")
Diffstat (limited to 'tests/sys')
-rw-r--r-- | tests/sys/net/if_ovpn/if_ovpn.sh | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh index 531a4fc2c856..83bf13bf0cba 100644 --- a/tests/sys/net/if_ovpn/if_ovpn.sh +++ b/tests/sys/net/if_ovpn/if_ovpn.sh @@ -407,6 +407,7 @@ timeout_client_body() vnet_mkjail a ${l}a jexec a ifconfig ${l}a 192.0.2.1/24 up + jexec a ifconfig lo0 127.0.0.1/8 up vnet_mkjail b ${l}b jexec b ifconfig ${l}b 192.0.2.2/24 up @@ -434,6 +435,8 @@ timeout_client_body() topology subnet keepalive 2 10 + + management 192.0.2.1 1234 " ovpn_start b " dev tun0 @@ -449,8 +452,7 @@ timeout_client_body() key $(atf_get_srcdir)/client.key dh $(atf_get_srcdir)/dh.pem - ping 2 - ping-exit 10 + keepalive 2 10 " # Give the tunnel time to come up @@ -458,16 +460,16 @@ timeout_client_body() atf_check -s exit:0 -o ignore jexec b ping -c 3 198.51.100.1 - # Kill the server - jexec a killall openvpn + # Kill the client + jexec b killall openvpn - # Now wait for the client to notice - sleep 20 + # Now wait for the server to notice + sleep 15 - if [ jexec b pgrep openvpn ]; then - jexec b ps auxf - atf_fail "OpenVPN client still running?" - fi + while echo "status" | jexec a nc -N 192.0.2.1 1234 | grep 192.0.2.2; do + echo "Client disconnect not discovered" + sleep 1 + done } timeout_client_cleanup() |