]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: udev - Signal that test was skipped when running as non-root 1088/head
authorFilipe Brandenburger <filbranden@google.com>
Mon, 31 Aug 2015 05:10:30 +0000 (22:10 -0700)
committerFilipe Brandenburger <filbranden@google.com>
Mon, 31 Aug 2015 05:10:30 +0000 (22:10 -0700)
It is more accurate to report that the test was skipped rather than
succeeded if we did not get to run it because it requires root.

Tested by running `make check` and inspecting the log file:

  $ cat test/udev-test.pl.log
  Must have root permissions to run properly.
  SKIP test/udev-test.pl (exit status: 77)

The `make check` output also reported:

  SKIP: test/udev-test.pl

test/udev-test.pl

index 64d7f934445ef181fa133defdeec8b7515d6add0..0a8930357005749ad209654596dab3ea8617e7b7 100755 (executable)
@@ -1487,7 +1487,7 @@ sub run_test {
 # due to mknod restrictions
 if (!($<==0)) {
         print "Must have root permissions to run properly.\n";
-        exit;
+        exit($EXIT_TEST_SKIP);
 }
 
 # skip the test when running in a container