]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: don't run private device tests if running in a container 3821/head
authorSteve Muir <muir@fb.com>
Wed, 27 Jul 2016 21:23:44 +0000 (14:23 -0700)
committerDavide Cavalca <dcavalca@fb.com>
Fri, 29 Jul 2016 21:30:46 +0000 (14:30 -0700)
Private devices don't exist when running in a container, so skip the related
tests.

src/test/test-execute.c

index 77ef4e8b2acf1cc3e3bff4c041baa40506ffa511..baf5b9648710c46ec72f819b32bc35d19ae1a119 100644 (file)
@@ -33,6 +33,7 @@
 #include "test-helper.h"
 #include "unit.h"
 #include "util.h"
+#include "virt.h"
 
 typedef void (*test_function_t)(Manager *m);
 
@@ -111,6 +112,10 @@ static void test_exec_privatetmp(Manager *m) {
 }
 
 static void test_exec_privatedevices(Manager *m) {
+        if (detect_container() > 0) {
+                log_notice("testing in container, skipping private device tests");
+                return;
+        }
         test(m, "exec-privatedevices-yes.service", 0, CLD_EXITED);
         test(m, "exec-privatedevices-no.service", 0, CLD_EXITED);
 }