Skip to content

Commit

Permalink
Merge pull request containers#7031 from vrothberg/root-check
Browse files Browse the repository at this point in the history
unit tests: root check
  • Loading branch information
openshift-merge-robot authored Jul 21, 2020
2 parents df6920a + d628de3 commit 644b5bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
5 changes: 5 additions & 0 deletions hack/check_root.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
if ! [ $(id -u) = 0 ]; then
echo "Please run as root! '$@' requires root privileges."
exit 1
fi

0 comments on commit 644b5bc

Please sign in to comment.