Skip to content

Commit

Permalink
Fix sigterm test at last
Browse files Browse the repository at this point in the history
Make the main script wait for the device to be *up* not just exist.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
dwmw2 committed May 1, 2020
1 parent 21a6a79 commit 72364c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions tests/scripts/vpnc-script-detect-disconnect
Expand Up @@ -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}
Expand Down
4 changes: 1 addition & 3 deletions tests/sigterm
Expand Up @@ -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
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit 72364c8

Please sign in to comment.