]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Prevent integration test timeout bc. of sudo
authorJens Neuhalfen <jens@neuhalfen.name>
Sun, 8 May 2016 16:17:48 +0000 (18:17 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 9 May 2016 18:17:01 +0000 (20:17 +0200)
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 <jens@neuhalfen.name>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <280154CA-9468-429B-BCAC-DB632C0AFB32@neuhalfen.name>
URL: http://article.gmane.org/gmane.network.openvpn.devel/11622
Signed-off-by: Gert Doering <gert@greenie.muc.de>
tests/t_client.sh.in

index d4f7c4ab33004ebbb7868d536d65f6cb81cac828..9a0af93a0d1734fb38765822583c1b2489664ee2 100755 (executable)
@@ -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