Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net/if_wg Update the if_wg tests for the human readabl...



details:   https://anonhg.NetBSD.org/src/rev/39168b0c7afe
branches:  trunk
changeset: 1013491:39168b0c7afe
user:      tih <tih%NetBSD.org@localhost>
date:      Sat Aug 29 07:22:49 2020 +0000

description:
Update the if_wg tests for the human readable 'latest-handshake'
output of wgconfig.

diffstat:

 tests/net/if_wg/t_misc.sh   |  11 +++++------
 tests/net/if_wg/t_tunnel.sh |   6 +++---
 2 files changed, 8 insertions(+), 9 deletions(-)

diffs (79 lines):

diff -r ffca6c2863ab -r 39168b0c7afe tests/net/if_wg/t_misc.sh
--- a/tests/net/if_wg/t_misc.sh Sat Aug 29 07:17:23 2020 +0000
+++ b/tests/net/if_wg/t_misc.sh Sat Aug 29 07:22:49 2020 +0000
@@ -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@localhost>
 # All rights reserved.
@@ -81,7 +81,7 @@
        $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 @@
            $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 @@
        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 @@
            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 @@
        $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 -r ffca6c2863ab -r 39168b0c7afe tests/net/if_wg/t_tunnel.sh
--- a/tests/net/if_wg/t_tunnel.sh       Sat Aug 29 07:17:23 2020 +0000
+++ b/tests/net/if_wg/t_tunnel.sh       Sat Aug 29 07:22:49 2020 +0000
@@ -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@localhost>
 # All rights reserved.
@@ -267,14 +267,14 @@
            $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



Home | Main Index | Thread Index | Old Index