mirror of
https://github.com/containers/podman.git
synced 2025-05-17 23:26:08 +08:00
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:
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) \
|
||||
|
5
hack/check_root.sh
Executable file
5
hack/check_root.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
if ! [ $(id -u) = 0 ]; then
|
||||
echo "Please run as root! '$@' requires root privileges."
|
||||
exit 1
|
||||
fi
|
Reference in New Issue
Block a user