test: if we're not root, return with status 77

exit code 77 signals "skip this test"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2017-09-27 13:50:11 +10:00
parent 84d49ee49c
commit 916e8296f6

View file

@ -3563,6 +3563,13 @@ main(int argc, char **argv)
const struct rlimit corelimit = { 0, 0 };
enum litest_mode mode;
if (getuid() != 0) {
fprintf(stderr,
"%s must be run as root.\n",
program_invocation_short_name);
return 77;
}
litest_init_test_devices();
list_init(&all_tests);