From 72364c8d02c6c1ac46663874bd85519956863847 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Fri, 1 May 2020 12:06:17 +0100 Subject: [PATCH] Fix sigterm test at last Make the main script wait for the device to be *up* not just exist. Signed-off-by: David Woodhouse --- tests/scripts/vpnc-script-detect-disconnect | 4 +--- tests/sigterm | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/scripts/vpnc-script-detect-disconnect b/tests/scripts/vpnc-script-detect-disconnect index 69e2330f..fe6d1c71 100755 --- a/tests/scripts/vpnc-script-detect-disconnect +++ b/tests/scripts/vpnc-script-detect-disconnect @@ -4,9 +4,7 @@ # For a real one, see http://www.infradead.org/openconnect/vpnc-script.html if [ "$reason" = "connect" ]; then - ip link show "$TUNDEV" - ip link set dev "$TUNDEV" up - ip link set dev "$TUNDEV" mtu "$INTERNAL_IP4_MTU" + ip link set dev "$TUNDEV" up mtu "$INTERNAL_IP4_MTU" ip addr add "$INTERNAL_IP4_ADDRESS/32" peer "$INTERNAL_IP4_ADDRESS" dev "$TUNDEV" ip -6 addr add $INTERNAL_IP6_NETMASK dev $TUNDEV rm -f ${DISCONNECT_FILE} diff --git a/tests/sigterm b/tests/sigterm index 8412e7b5..8a0e309d 100755 --- a/tests/sigterm +++ b/tests/sigterm @@ -33,8 +33,6 @@ export DISCONNECT_FILE=disconnected-ok.$$.tmp . `dirname $0`/common.sh -set -x - rm -f ${DISCONNECT_FILE} if test -z "${IP}";then @@ -104,7 +102,7 @@ set -e echo " * wait for ${TUNDEV}" TIMEOUT=10 -while ! ${CMDNS1} ip addr list dev ${TUNDEV} &>/dev/null; do +while ! ${CMDNS1} ip link show dev ${TUNDEV} 2>/dev/null | grep -q UP; do TIMEOUT=$(($TIMEOUT - 1)) if [ $TIMEOUT -eq 0 ]; then echo "Timed out waiting for ${TUNDEV}" -- 2.50.1