summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-07-09 18:28:57 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-07-23 13:13:44 -0300
commit7d942ea5af0dfe5b4f693dc0254b9bbdf1677dec (patch)
treeead74235180b8ab783fafb11f3063499d22bed6a
parent5cafc4510eb2a1998d910647d39518a5048b9e18 (diff)
downloadmullvadvpn-7d942ea5af0dfe5b4f693dc0254b9bbdf1677dec.tar.xz
mullvadvpn-7d942ea5af0dfe5b4f693dc0254b9bbdf1677dec.zip
Check for administrator permissions on Windows
-rwxr-xr-xintegration-tests.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/integration-tests.sh b/integration-tests.sh
index f69614109f..4de1085972 100755
--- a/integration-tests.sh
+++ b/integration-tests.sh
@@ -1,8 +1,21 @@
#!/usr/bin/env bash
-if [ "$UID" -ne 0 ]; then
- echo "WARNING: Not running as root, some tests may fail" >&2
-fi
+case "$(uname -s)" in
+ Linux*)
+ if [ "$UID" -ne 0 ]; then
+ echo "WARNING: Not running as root, some tests may fail" >&2
+ fi
+ ;;
+ MINGW*)
+ if ! net session &> /dev/null; then
+ echo "WARNING: Not running as administrator, some tests may fail" >&2
+ fi
+ ;;
+ *)
+ echo "ERROR: Platform $OSTYPE not supported"
+ exit 1
+ ;;
+esac
MULLVAD_DIR="$(cd "$(dirname "$0")"; pwd -P)"