summaryrefslogtreecommitdiffstats
path: root/src/test/test-cgroup-util.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <dimitri.j.ledkov@intel.com>2015-06-01 13:46:52 +0200
committerDimitri John Ledkov <dimitri.j.ledkov@intel.com>2015-06-02 12:25:52 +0200
commit185a08745957cbd32e8293daf8c51ab9c995a71e (patch)
tree182b8fe7d51a34fbbc34870f1312c7f2eb136784 /src/test/test-cgroup-util.c
parenttest-unit-file: add test for improperly escaped exec string (diff)
downloadsystemd-185a08745957cbd32e8293daf8c51ab9c995a71e.tar.xz
systemd-185a08745957cbd32e8293daf8c51ab9c995a71e.zip
shared: Drop 'name=' prefix from SYSTEMD_CGROUP_CONTROLLER define.
In cgtop,mount-setup,nspawn the name= prefix is hard-coded in the mount options, and the define is not used. Everywhere else, we explicitly white-list allow 'name=' prefix to be used with all controllers, and strip it out to 'normalise' the controller name. That work is mostly inflicted on us due to 'name=' prefix in the define. Dropping this prefix makes everything more sane overall.
Diffstat (limited to 'src/test/test-cgroup-util.c')
-rw-r--r--src/test/test-cgroup-util.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c
index 4a89f64518..ecc9d70bf4 100644
--- a/src/test/test-cgroup-util.c
+++ b/src/test/test-cgroup-util.c
@@ -244,16 +244,16 @@ static void test_escape(void) {
}
static void test_controller_is_valid(void) {
- assert_se(cg_controller_is_valid("foobar", false));
- assert_se(cg_controller_is_valid("foo_bar", false));
- assert_se(cg_controller_is_valid("name=foo", true));
- assert_se(!cg_controller_is_valid("", false));
- assert_se(!cg_controller_is_valid("name=", true));
- assert_se(!cg_controller_is_valid("=", false));
- assert_se(!cg_controller_is_valid("cpu,cpuacct", false));
- assert_se(!cg_controller_is_valid("_", false));
- assert_se(!cg_controller_is_valid("_foobar", false));
- assert_se(!cg_controller_is_valid("tatü", false));
+ assert_se(cg_controller_is_valid("foobar"));
+ assert_se(cg_controller_is_valid("foo_bar"));
+ assert_se(cg_controller_is_valid("name=foo"));
+ assert_se(!cg_controller_is_valid(""));
+ assert_se(!cg_controller_is_valid("name="));
+ assert_se(!cg_controller_is_valid("="));
+ assert_se(!cg_controller_is_valid("cpu,cpuacct"));
+ assert_se(!cg_controller_is_valid("_"));
+ assert_se(!cg_controller_is_valid("_foobar"));
+ assert_se(!cg_controller_is_valid("tatü"));
}
static void test_slice_to_path_one(const char *unit, const char *path, int error) {