summaryrefslogtreecommitdiff
path: root/tests/e2e/e2e-test-vpn.sh
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2017-06-05 17:31:37 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2017-06-07 12:31:25 +0200
commit05f2b9d2b72139df56f67e88aeb7ceb6d8ec4e69 (patch)
tree6fce3da1defff38fe799321e3adfa7bc56537295 /tests/e2e/e2e-test-vpn.sh
parent1c418514c6f3ea57570023833ef66d2c9d3473f2 (diff)
[feature] run vpn directly if user is root
- Improve tests too: add entry in resolv.conf, not done without resolvconf
Diffstat (limited to 'tests/e2e/e2e-test-vpn.sh')
-rwxr-xr-xtests/e2e/e2e-test-vpn.sh29
1 files changed, 15 insertions, 14 deletions
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"