c2dfb7
From fb66f2dbf1d228adc6f15edbbdf0ce53eb3be982 Mon Sep 17 00:00:00 2001
c2dfb7
From: Yu Watanabe <watanabe.yu+github@gmail.com>
c2dfb7
Date: Fri, 14 Sep 2018 15:47:42 +0900
c2dfb7
Subject: [PATCH] test-execute: skip several tests when running in container
c2dfb7
c2dfb7
(cherry picked from commit 642d1a6d6e98204ade25816bcc429cb67df92a29)
c2dfb7
c2dfb7
Resolves: #1823767
c2dfb7
---
c2dfb7
 src/test/test-execute.c | 12 +++++++++++-
c2dfb7
 1 file changed, 11 insertions(+), 1 deletion(-)
c2dfb7
c2dfb7
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
c2dfb7
index af64427bc7..637ffe96bb 100644
c2dfb7
--- a/src/test/test-execute.c
c2dfb7
+++ b/src/test/test-execute.c
c2dfb7
@@ -616,14 +616,24 @@ static void test_exec_privatenetwork(Manager *m) {
c2dfb7
 
c2dfb7
 static void test_exec_oomscoreadjust(Manager *m) {
c2dfb7
         test(m, "exec-oomscoreadjust-positive.service", 0, CLD_EXITED);
c2dfb7
+
c2dfb7
+        if (detect_container() > 0) {
c2dfb7
+                log_notice("Testing in container, skipping remaining tests in %s", __func__);
c2dfb7
+                return;
c2dfb7
+        }
c2dfb7
         test(m, "exec-oomscoreadjust-negative.service", 0, CLD_EXITED);
c2dfb7
 }
c2dfb7
 
c2dfb7
 static void test_exec_ioschedulingclass(Manager *m) {
c2dfb7
         test(m, "exec-ioschedulingclass-none.service", 0, CLD_EXITED);
c2dfb7
         test(m, "exec-ioschedulingclass-idle.service", 0, CLD_EXITED);
c2dfb7
-        test(m, "exec-ioschedulingclass-realtime.service", 0, CLD_EXITED);
c2dfb7
         test(m, "exec-ioschedulingclass-best-effort.service", 0, CLD_EXITED);
c2dfb7
+
c2dfb7
+        if (detect_container() > 0) {
c2dfb7
+                log_notice("Testing in container, skipping remaining tests in %s", __func__);
c2dfb7
+                return;
c2dfb7
+        }
c2dfb7
+        test(m, "exec-ioschedulingclass-realtime.service", 0, CLD_EXITED);
c2dfb7
 }
c2dfb7
 
c2dfb7
 static void test_exec_unsetenvironment(Manager *m) {