anitazha / rpms / systemd

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