anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone
803fb7
From a1c4eecf9a334e5841744cabdc18bdfdc108a636 Mon Sep 17 00:00:00 2001
803fb7
From: Lukas Nykryn <lnykryn@redhat.com>
803fb7
Date: Fri, 21 Apr 2017 15:44:25 +0200
803fb7
Subject: [PATCH] tests: set tasks_max to infinity
803fb7
803fb7
rhel-only
803fb7
(upstream does the same but the code there is quite different)
803fb7
803fb7
Related: #1337244
803fb7
---
803fb7
 src/test/test-cgroup-mask.c | 11 +++++++++++
803fb7
 src/test/test-execute.c     |  5 +++++
803fb7
 2 files changed, 16 insertions(+)
803fb7
803fb7
diff --git a/src/test/test-cgroup-mask.c b/src/test/test-cgroup-mask.c
803fb7
index 9e9de23e0..471adb25b 100644
803fb7
--- a/src/test/test-cgroup-mask.c
803fb7
+++ b/src/test/test-cgroup-mask.c
803fb7
@@ -45,6 +45,17 @@ static int test_cgroup_mask(void) {
803fb7
                 puts("manager_new: Permission denied. Skipping test.");
803fb7
                 return EXIT_TEST_SKIP;
803fb7
         }
803fb7
+        assert_se(r >= 0);
803fb7
+
803fb7
+        /* Turn off all kinds of default accouning, so that we can
803fb7
+         * verify the masks resulting of our configuration and nothing
803fb7
+         * else. */
803fb7
+        m->default_cpu_accounting =
803fb7
+                m->default_memory_accounting =
803fb7
+                m->default_blockio_accounting =
803fb7
+                m->default_tasks_accounting = false;
803fb7
+        m->default_tasks_max = (uint64_t) -1;
803fb7
+
803fb7
         assert_se(r >= 0);
803fb7
         assert_se(manager_startup(m, serial, fdset) >= 0);
803fb7
 
803fb7
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
803fb7
index 8e70702cb..627097fcf 100644
803fb7
--- a/src/test/test-execute.c
803fb7
+++ b/src/test/test-execute.c
803fb7
@@ -270,6 +270,11 @@ int main(int argc, char *argv[]) {
803fb7
         }
803fb7
         assert_se(r >= 0);
803fb7
         assert_se(manager_startup(m, NULL, NULL) >= 0);
803fb7
+        m->default_cpu_accounting =
803fb7
+                m->default_memory_accounting =
803fb7
+                m->default_blockio_accounting =
803fb7
+                m->default_tasks_accounting = false;
803fb7
+        m->default_tasks_max = (uint64_t) -1;
803fb7
 
803fb7
         for (test = tests; test && *test; test++)
803fb7
                 (*test)(m);