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 <rothberg@redhat.com>
This commit is contained in:
parent
df6920aa79
commit
d628de31d7
1
Makefile
1
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) \
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
if ! [ $(id -u) = 0 ]; then
|
||||
echo "Please run as root! '$@' requires root privileges."
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue