From 05f2b9d2b72139df56f67e88aeb7ceb6d8ec4e69 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Mon, 5 Jun 2017 17:31:37 +0200 Subject: [feature] run vpn directly if user is root - Improve tests too: add entry in resolv.conf, not done without resolvconf --- tests/e2e/e2e-test-vpn.sh | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'tests/e2e') diff --git a/tests/e2e/e2e-test-vpn.sh b/tests/e2e/e2e-test-vpn.sh index 5a2cc1bd..26be34c8 100755 --- a/tests/e2e/e2e-test-vpn.sh +++ b/tests/e2e/e2e-test-vpn.sh @@ -6,8 +6,8 @@ # exit if any commands returns non-zero status set -e -# XXX DEBUG -set -x +# ONLY ENABLE THIS TO DEBUG +# set -x # Check if scipt is run in debug mode so we can hide secrets if [[ "$-" =~ 'x' ]] @@ -47,31 +47,32 @@ set +x # Authenticate "$BCTL" user auth "$user" --pass "$pw" > /dev/null -# Enable VPN -"$BCTL" vpn enable - # Get VPN cert "$BCTL" vpn get_cert "$user" +# Start VPN, wait a bit "$BCTL" vpn start --json +sleep 3 +"$BCTL" vpn status --json -# XXX DEBUG --- -tail -n 200 ~/.config/leap/bitmaskd.log -which pkexec -ls -la /usr/sbin/openvpn -ls -la /usr/local/sbin/bitmask-root -# XXX DEBUG --- - +# XXX gateway does not get added to resolv.conf +echo "nameserver 10.42.0.1" > /etc/resolv.conf +# cat /etc/resolv.conf sleep 5 -"$BCTL" vpn status --json +#ip link show +# TEST that we're going through the provider's VPN tests/e2e/check_ip vpn_on "$BCTL" vpn stop +sleep 3 + +# XXX debug do this only if no other entry in resolv.conf +echo "nameserver 77.109.148.136" > /etc/resolv.conf -sleep 5 +# TEST that we're NOT going through the provider's VPN tests/e2e/check_ip vpn_off echo "Succeeded - the vpn routed you through the expected address" -- cgit v1.2.3