Source-Changes-HG archive

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

[src/trunk]: src/tests/net/ipsec tests: add missing ifconfig -w



details:   https://anonhg.NetBSD.org/src/rev/c275b1c11a98
branches:  trunk
changeset: 744921:c275b1c11a98
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Feb 17 08:46:10 2020 +0000

description:
tests: add missing ifconfig -w

This change mitigates PR kern/54897.

diffstat:

 tests/net/ipsec/t_ipsec_gif.sh  |  21 ++++++++++++++++-----
 tests/net/ipsec/t_ipsec_l2tp.sh |  19 ++++++++++++++-----
 2 files changed, 30 insertions(+), 10 deletions(-)

diffs (96 lines):

diff -r 3a37c7fe79a1 -r c275b1c11a98 tests/net/ipsec/t_ipsec_gif.sh
--- a/tests/net/ipsec/t_ipsec_gif.sh    Mon Feb 17 08:16:44 2020 +0000
+++ b/tests/net/ipsec/t_ipsec_gif.sh    Mon Feb 17 08:46:10 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_ipsec_gif.sh,v 1.8 2019/08/19 03:22:05 ozaki-r Exp $
+#      $NetBSD: t_ipsec_gif.sh,v 1.9 2020/02/17 08:46:10 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -59,6 +59,15 @@
        echo "$src > $dst: $proto_cap.+$inner_str"
 }
 
+wait_for_all_dad_completions()
+{
+
+       for sock in $SOCK_LOCAL $SOCK_TUN_LOCAL $SOCK_TUN_REMOTE $SOCK_REMOTE; do
+               export RUMP_SERVER=$sock
+               atf_check -s exit:0 rump.ifconfig -w 10
+       done
+}
+
 test_ipsec4_gif()
 {
        local mode=$1
@@ -121,8 +130,9 @@
 
        export RUMP_SERVER=$SOCK_REMOTE
        atf_check -s exit:0 rump.ifconfig shmif0 $ip_remote/24
-       # Run ifconfig -w 10 just once for optimization
-       atf_check -s exit:0 rump.ifconfig -w 10
+
+       wait_for_all_dad_completions
+
        atf_check -s exit:0 -o ignore \
            rump.route -n add -net $subnet_local $ip_gw_remote
 
@@ -273,8 +283,9 @@
 
        export RUMP_SERVER=$SOCK_REMOTE
        atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip_remote
-       # Run ifconfig -w 10 just once for optimization
-       atf_check -s exit:0 rump.ifconfig -w 10
+
+       wait_for_all_dad_completions
+
        atf_check -s exit:0 -o ignore \
            rump.route -n add -inet6 -net $subnet_local/64 $ip_gw_remote
 
diff -r 3a37c7fe79a1 -r c275b1c11a98 tests/net/ipsec/t_ipsec_l2tp.sh
--- a/tests/net/ipsec/t_ipsec_l2tp.sh   Mon Feb 17 08:16:44 2020 +0000
+++ b/tests/net/ipsec/t_ipsec_l2tp.sh   Mon Feb 17 08:46:10 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_ipsec_l2tp.sh,v 1.8 2019/08/19 03:22:05 ozaki-r Exp $
+#      $NetBSD: t_ipsec_l2tp.sh,v 1.9 2020/02/17 08:46:10 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -62,6 +62,15 @@
        echo "$src > $dst: $proto_cap.+$proto_str"
 }
 
+wait_for_all_dad_completions()
+{
+
+       for sock in $SOCK_LOCAL $SOCK_TUN_LOCAL $SOCK_TUN_REMOTE $SOCK_REMOTE; do
+               export RUMP_SERVER=$sock
+               atf_check -s exit:0 rump.ifconfig -w 10
+       done
+}
+
 test_ipsec4_l2tp()
 {
        local mode=$1
@@ -121,8 +130,8 @@
 
        export RUMP_SERVER=$SOCK_REMOTE
        atf_check -s exit:0 rump.ifconfig shmif0 $ip_remote/24
-       # Run ifconfig -w 10 just once for optimization
-       atf_check -s exit:0 rump.ifconfig -w 10
+
+       wait_for_all_dad_completions
 
        extract_new_packets $BUS_TUNNEL > $outfile
 
@@ -263,8 +272,8 @@
 
        export RUMP_SERVER=$SOCK_REMOTE
        atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip_remote
-       # Run ifconfig -w 10 just once for optimization
-       atf_check -s exit:0 rump.ifconfig -w 10
+
+       wait_for_all_dad_completions
 
        extract_new_packets $BUS_TUNNEL > $outfile
 



Home | Main Index | Thread Index | Old Index