summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-07-21 09:39:08 -0400
committerGitHub <noreply@github.com>2020-07-21 09:39:08 -0400
commit644b5bc8a35760654824c46cad8618e0d6e634bc (patch)
treee19bb1e811fbf4303895798f582f71dea2e5bdf2
parentdf6920aa79073b2767d24c6524367384b6284b31 (diff)
parentd628de31d71b1849fdb102f8689faa80fe286b83 (diff)
downloadpodman-644b5bc8a35760654824c46cad8618e0d6e634bc.tar.gz
podman-644b5bc8a35760654824c46cad8618e0d6e634bc.tar.bz2
podman-644b5bc8a35760654824c46cad8618e0d6e634bc.zip
Merge pull request #7031 from vrothberg/root-check
unit tests: root check
-rw-r--r--Makefile1
-rwxr-xr-xhack/check_root.sh5
2 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 71b4772c4..132dde939 100644
--- a/Makefile
+++ b/Makefile
@@ -307,6 +307,7 @@ testunit: libpodimage ## Run unittest on the built image
.PHONY: localunit
localunit: test/goecho/goecho varlink_generate
+ hack/check_root.sh make localunit
ginkgo \
-r \
$(TESTFLAGS) \
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