test-execute: skip several tests when running in container
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 14 Sep 2018 06:47:42 +0000 (15:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 Sep 2018 15:45:00 +0000 (00:45 +0900)
src/test/test-execute.c

index 80b60d0..ade02b1 100644 (file)
@@ -640,14 +640,24 @@ static void test_exec_privatenetwork(Manager *m) {
 
 static void test_exec_oomscoreadjust(Manager *m) {
         test(m, "exec-oomscoreadjust-positive.service", 0, CLD_EXITED);
+
+        if (detect_container() > 0) {
+                log_notice("Testing in container, skipping remaining tests in %s", __func__);
+                return;
+        }
         test(m, "exec-oomscoreadjust-negative.service", 0, CLD_EXITED);
 }
 
 static void test_exec_ioschedulingclass(Manager *m) {
         test(m, "exec-ioschedulingclass-none.service", 0, CLD_EXITED);
         test(m, "exec-ioschedulingclass-idle.service", 0, CLD_EXITED);
-        test(m, "exec-ioschedulingclass-realtime.service", 0, CLD_EXITED);
         test(m, "exec-ioschedulingclass-best-effort.service", 0, CLD_EXITED);
+
+        if (detect_container() > 0) {
+                log_notice("Testing in container, skipping remaining tests in %s", __func__);
+                return;
+        }
+        test(m, "exec-ioschedulingclass-realtime.service", 0, CLD_EXITED);
 }
 
 static void test_exec_unsetenvironment(Manager *m) {