From 885471cf0c9918a8a7edbae2b8985e2321aff739 Mon Sep 17 00:00:00 2001
From: Jens Neuhalfen <j...@neuhalfen.name>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Sun, 8 May 2016 18:17:48 +0200
Subject: [PATCH] Prevent integration test timeout bc. of sudo

Integration tests run by t_client.sh use sudo to run openvpn as root.

If the t_client.sh script is configured to use sudo then the user
must enter the password quickly because t_client assumes a startup
failure if openvpn does not start quick enough.

If the user is not quick enough, then the tests fails.

This change will refresh the sudo timestamp at the start of the script.

Tested on MacOS X & Ubuntu Precise

Signed-off-by: Jens Neuhalfen <j...@neuhalfen.name>
---
tests/t_client.sh.in | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/tests/t_client.sh.in b/tests/t_client.sh.in
index d4f7c4a..9a0af93 100755
--- a/tests/t_client.sh.in
+++ b/tests/t_client.sh.in
@@ -69,6 +69,11 @@ else
        echo "$0: this test must run be as root, or RUN_SUDO=... " >&2
        echo "      must be set correctly in 't_client.rc'. SKIP." >&2
        exit 77
+    else
+        # We have to use sudo. Make sure that we (hopefully) do not have
+        # to ask the users password during the test. This is done to
+        # prevent timing issues, e.g. when the waits for openvpn to start
+        $RUN_SUDO \true
    fi
fi

--
2.8.2

Reply via email to