summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortih <tih@NetBSD.org>2020-08-29 07:22:49 +0000
committertih <tih@NetBSD.org>2020-08-29 07:22:49 +0000
commitfa15de304968eec784657a94ea4cfe24b17c8395 (patch)
tree17ff5761f2850909df1ed29725d5793a5a5bd888
parent090864fdfd5a591e51d6c7199106c4ff9ec0976c (diff)
Update the if_wg tests for the human readable 'latest-handshake'
output of wgconfig.
-rw-r--r--tests/net/if_wg/t_misc.sh11
-rw-r--r--tests/net/if_wg/t_tunnel.sh6
2 files changed, 8 insertions, 9 deletions
diff --git a/tests/net/if_wg/t_misc.sh b/tests/net/if_wg/t_misc.sh
index 389b36a7ffc..dce78ad99ce 100644
--- a/tests/net/if_wg/t_misc.sh
+++ b/tests/net/if_wg/t_misc.sh
@@ -1,4 +1,4 @@
-# $NetBSD: t_misc.sh,v 1.3 2020/08/27 02:52:33 riastradh Exp $
+# $NetBSD: t_misc.sh,v 1.4 2020/08/29 07:22:49 tih Exp $
#
# Copyright (c) 2018 Ryota Ozaki <ozaki.ryota@gmail.com>
# All rights reserved.
@@ -81,7 +81,7 @@ wg_rekey_body()
$ping $ip_wg_peer
latest_handshake=$($HIJACKING wgconfig wg0 show peer peer0 \
- | awk -F : '/latest-handshake/ {print $2;}')
+ | awk -F ': ' '/latest-handshake/ {print $2;}')
$DEBUG && echo $latest_handshake
sleep 1
@@ -102,7 +102,7 @@ wg_rekey_body()
$HIJACKING wgconfig wg0 show peer peer0
latest_handshake=$($HIJACKING wgconfig wg0 show peer peer0 \
- | awk -F : '/latest-handshake/ {print $2;}')
+ | awk -F ': ' '/latest-handshake/ {print $2;}')
$DEBUG && echo $latest_handshake
# Wait for a reinitiation to be performed again
@@ -142,7 +142,6 @@ wg_handshake_timeout_body()
local ip_wg_peer=10.0.0.2
local port=51820
local rekey_after_time=3
- local latest_handshake=
local outfile=./out
local rekey_timeout=3
local rekey_attempt_time=8
@@ -278,7 +277,7 @@ wg_cookie_body()
cat $outfile
$DEBUG && $HIJACKING wgconfig wg0 show all
- atf_check -s exit:0 -o match:"latest-handshake: 0" \
+ atf_check -s exit:0 -o match:"latest-handshake: \(never\)" \
$HIJACKING wgconfig wg0
# Wait for restarting a session
@@ -289,7 +288,7 @@ wg_cookie_body()
$ping $ip_wg_peer
$DEBUG && $HIJACKING wgconfig wg0 show all
- atf_check -s exit:0 -o not-match:"latest-handshake: 0" \
+ atf_check -s exit:0 -o not-match:"latest-handshake: \(never\)" \
$HIJACKING wgconfig wg0
destroy_wg_interfaces
diff --git a/tests/net/if_wg/t_tunnel.sh b/tests/net/if_wg/t_tunnel.sh
index 817ae6b5c1d..47908ccfe70 100644
--- a/tests/net/if_wg/t_tunnel.sh
+++ b/tests/net/if_wg/t_tunnel.sh
@@ -1,4 +1,4 @@
-# $NetBSD: t_tunnel.sh,v 1.1 2020/08/26 16:03:42 riastradh Exp $
+# $NetBSD: t_tunnel.sh,v 1.2 2020/08/29 07:22:49 tih Exp $
#
# Copyright (c) 2018 Ryota Ozaki <ozaki.ryota@gmail.com>
# All rights reserved.
@@ -267,14 +267,14 @@ wg_tunnel_common()
$ip_wg_local/$inner_prefixall,$subnet_local
export RUMP_SERVER=$SOCK_TUN_LOCAL
- atf_check -s exit:0 -o match:"latest-handshake: 0" \
+ atf_check -s exit:0 -o match:"latest-handshake: \(never\)" \
$HIJACKING wgconfig wg0 show peer peer0
export RUMP_SERVER=$SOCK_LOCAL
check_ping $inner_proto $ip_peer
export RUMP_SERVER=$SOCK_TUN_LOCAL
- atf_check -s exit:0 -o not-match:"latest-handshake: 0" \
+ atf_check -s exit:0 -o not-match:"latest-handshake: \(never\)" \
$HIJACKING wgconfig wg0 show peer peer0
export RUMP_SERVER=$SOCK_LOCAL