chiark / gitweb /
core: epoll and signalfd has been moved into sd event loop
[elogind.git] / src / test / test-cgroup-util.c
index 295bb02e3be788952fabd8a81787fe24e0abf3e7..4d802d483a912fb317a4edc7261b2780918a554d 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "util.h"
 #include "cgroup-util.h"
+#include "test-helper.h"
 
 static void check_p_d_u(const char *path, int code, const char *result) {
         _cleanup_free_ char *unit = NULL;
@@ -192,8 +193,9 @@ static void test_escape(void) {
         test_escape_one(".foobar", "_.foobar");
         test_escape_one("foobar.service", "foobar.service");
         test_escape_one("cgroup.service", "_cgroup.service");
-        test_escape_one("cpu.service", "_cpu.service");
         test_escape_one("tasks", "_tasks");
+        if (access("/sys/fs/cgroup/cpu", F_OK) == 0)
+                test_escape_one("cpu.service", "_cpu.service");
         test_escape_one("_foobar", "__foobar");
         test_escape_one("", "_");
         test_escape_one("_", "__");
@@ -239,9 +241,9 @@ int main(void) {
         test_path_get_session();
         test_path_get_owner_uid();
         test_path_get_machine_name();
-        test_get_paths();
+        TEST_REQ_RUNNING_SYSTEMD(test_get_paths());
         test_proc();
-        test_escape();
+        TEST_REQ_RUNNING_SYSTEMD(test_escape());
         test_controller_is_valid();
         test_slice_to_path();