From d628de31d71b1849fdb102f8689faa80fe286b83 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Tue, 21 Jul 2020 13:30:07 +0200 Subject: unit tests: root check The unit tests currently require running as root. This has caused some confusion that justifies adding a root check to `make localunit` and error out for non-root users instead of starting the tests deemed to fail. Signed-off-by: Valentin Rothberg --- hack/check_root.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 hack/check_root.sh (limited to 'hack') diff --git a/hack/check_root.sh b/hack/check_root.sh new file mode 100755 index 000000000..203eae9d3 --- /dev/null +++ b/hack/check_root.sh @@ -0,0 +1,5 @@ +#!/bin/bash +if ! [ $(id -u) = 0 ]; then + echo "Please run as root! '$@' requires root privileges." + exit 1 +fi -- cgit v1.2.3-54-g00ecf