summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-11-15 21:07:43 +0100
committerAdrian Szyndela <adrian.s@samsung.com>2020-03-26 16:28:06 +0100
commitacdc1dd584c4c6cf32187adf95d43c4fe87b149f (patch)
treee4b5a407176df4b9f8e130294a248525056f660b /src/test
parent5978f91ad3d8159b6e3ff4f349c755a4dcfcf357 (diff)
downloadsystemd-acdc1dd584c4c6cf32187adf95d43c4fe87b149f.tar.gz
systemd-acdc1dd584c4c6cf32187adf95d43c4fe87b149f.tar.bz2
systemd-acdc1dd584c4c6cf32187adf95d43c4fe87b149f.zip
(backport) core: remove JoinControllers= configuration settingsandbox/adrians/upgrade-to-239
This removes the ability to configure which cgroup controllers to mount together. Instead, we'll now hardcode that "cpu" and "cpuacct" are mounted together as well as "net_cls" and "net_prio". The concept of mounting controllers together has no future as it does not exist to cgroupsv2. Moreover, the current logic is systematically broken, as revealed by the discussions in #10507. Also, we surveyed Red Hat customers and couldn't find a single user of the concept (which isn't particularly surprising, as it is broken...) This reduced the (already way too complex) cgroup handling for us, since we now know whenever we make a change to a cgroup for one controller to which other controllers it applies. Change-Id: I0eadd5f685980bd006134991310c0688ba7a86c5
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-conf-parser.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c
index ff951d12f4..7335ad6666 100644
--- a/src/test/test-conf-parser.c
+++ b/src/test/test-conf-parser.c
@@ -210,45 +210,6 @@ static void test_config_parse_iec_uint64(void) {
assert_se(config_parse_iec_uint64(NULL, "/this/file", 11, "Section", 22, "Size", 0, "4.5M", &offset, NULL) == 0);
}
-static void test_config_parse_join_controllers(void) {
- int r;
- _cleanup_(strv_free_freep) char ***c = NULL;
- char ***c2;
-
- /* Test normal operation */
- r = config_parse_join_controllers(NULL, "example.conf", 11, "Section", 10, "JoinControllers", 0, "cpu,cpuacct net_cls,netprio", &c, NULL);
- assert_se(r == 0);
- assert_se(c);
- assert_se(strv_length(c[0]) == 2);
- assert_se(strv_equal(c[0], STRV_MAKE("cpu", "cpuacct")));
- assert_se(strv_length(c[1]) == 2);
- assert_se(strv_equal(c[1], STRV_MAKE("net_cls", "netprio")));
- assert_se(c[2] == NULL);
-
- /* Test special case of no mounted controllers */
- r = config_parse_join_controllers(NULL, "example.conf", 12, "Section", 10, "JoinControllers", 0, "", &c, NULL);
- assert_se(r == 0);
- assert_se(c);
- assert_se(strv_equal(c[0], STRV_MAKE_EMPTY));
- assert_se(c[1] == NULL);
-
- /* Test merging of overlapping lists */
- r = config_parse_join_controllers(NULL, "example.conf", 13, "Section", 10, "JoinControllers", 0, "a,b b,c", &c, NULL);
- assert_se(r == 0);
- assert_se(c);
- assert_se(strv_length(c[0]) == 3);
- assert_se(strv_contains(c[0], "a"));
- assert_se(strv_contains(c[0], "b"));
- assert_se(strv_contains(c[0], "c"));
- assert_se(c[1] == NULL);
-
- /* Test ignoring of bad lines */
- c2 = c;
- r = config_parse_join_controllers(NULL, "example.conf", 14, "Section", 10, "JoinControllers", 0, "a,\"b ", &c, NULL);
- assert_se(r < 0);
- assert_se(c == c2);
-}
-
#define x10(x) x x x x x x x x x x
#define x100(x) x10(x10(x))
#define x1000(x) x10(x100(x))
@@ -398,7 +359,6 @@ int main(int argc, char **argv) {
test_config_parse_sec();
test_config_parse_nsec();
test_config_parse_iec_uint64();
- test_config_parse_join_controllers();
for (i = 0; i < ELEMENTSOF(config_file); i++)
test_config_parse(i, config_file[i]);