diff options
author | Kali Kaneko <kali@leap.se> | 2017-08-28 18:29:20 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2017-08-30 16:18:52 -0400 |
commit | 04d24156a8aa203b2201d1f26f45e4a48994a27b (patch) | |
tree | 168a3b45dae29da7fd6f2ea61f6d1b1f36a33dfc /tests/e2e | |
parent | 2ff3f6adf7ce24cf31f5ad398cebddef0ff0b0a1 (diff) |
[tests] add root-switch as dns workaround for tests on CI
Diffstat (limited to 'tests/e2e')
-rwxr-xr-x | tests/e2e/e2e-test-vpn.sh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/e2e/e2e-test-vpn.sh b/tests/e2e/e2e-test-vpn.sh index 593c1185..7675edd2 100755 --- a/tests/e2e/e2e-test-vpn.sh +++ b/tests/e2e/e2e-test-vpn.sh @@ -53,10 +53,14 @@ set +x sleep 5 "$BCTL" vpn status --json -# XXX gateway does not get added to resolv.conf -# If we are running as root, as in the CI, we can do this directly -# echo "nameserver 10.42.0.1" > /etc/resolv.conf -# cat /etc/resolv.conf +if [[ $EUID > 0 ]] + then echo "Not running as root, no dns workaround needed..."; +else + echo "no-iptables workaround on CI: adding gateway dns..."; + echo "nameserver 10.42.0.1" > /etc/resolv.conf + # cat /etc/resolv.conf +fi + sleep 5 ip link show @@ -68,8 +72,12 @@ tests/e2e/check_ip vpn_on "$BCTL" vpn stop sleep 5 -# XXX debug do this only if no other entry in resolv.conf -# echo "nameserver 77.109.148.136" > /etc/resolv.conf +if [[ $EUID > 0 ]] + then echo "Not running as root, no dns workaround needed..."; +else + echo "no-iptables workaround on CI: restoring dns..."; + echo "nameserver 77.109.148.136" > /etc/resolv.conf +fi # TEST that we're NOT going through the provider's VPN |