tests: skip process 1 tests if systemd not is running
authorDavide Cavalca <dcavalca@fb.com>
Wed, 27 Jul 2016 21:22:26 +0000 (14:22 -0700)
committerDavide Cavalca <dcavalca@fb.com>
Fri, 29 Jul 2016 21:30:46 +0000 (14:30 -0700)
No point running tests against process 1 if systemd is not running as that
process. This is a rework of an unpublished patch by @9muir.

src/test/test-process-util.c

index 562ad4a..9ada46b 100644 (file)
@@ -40,6 +40,7 @@
 #include "stdio-util.h"
 #include "string-util.h"
 #include "terminal-util.h"
+#include "test-helper.h"
 #include "util.h"
 #include "virt.h"
 
@@ -357,7 +358,7 @@ int main(int argc, char *argv[]) {
                 (void) parse_pid(argv[1], &pid);
                 test_get_process_comm(pid);
         } else {
-                test_get_process_comm(1);
+                TEST_REQ_RUNNING_SYSTEMD(test_get_process_comm(1));
                 test_get_process_comm(getpid());
         }