ryantimwilson / rpms / systemd

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