tests: add a check if tests requiring it are run by root
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
3360b2a404
commit
01cb587161
@ -298,3 +298,12 @@ os_repository_new_commit ()
|
||||
ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string "version=${version}" -b testos/buildmaster/x86_64-runtime -s "Build"
|
||||
cd ${test_tmpdir}
|
||||
}
|
||||
|
||||
check_root_test ()
|
||||
{
|
||||
if test "$(id -u)" != "0"; then
|
||||
echo 1>&2 "$0 can be run only as root"
|
||||
echo "1..0"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
@ -21,6 +21,8 @@ set -e
|
||||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
check_root_test
|
||||
|
||||
echo "1..1"
|
||||
|
||||
setup_os_repository "archive-z2" "syslinux"
|
||||
|
Loading…
Reference in New Issue
Block a user