#include "service.h"
#include "tests.h"
-TEST_RET(watch_pid) {
+TEST(watch_pid) {
_cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
_cleanup_(manager_freep) Manager *m = NULL;
Unit *a, *b, *c, *u;
- int r;
-
- if (getuid() != 0)
- return log_tests_skipped("not root");
- r = enter_cgroup_subroot(NULL);
- if (r < 0)
- return log_tests_skipped("cgroupfs not available");
_cleanup_free_ char *unit_dir = NULL;
ASSERT_OK(get_testdata_dir("units/", &unit_dir));
unit_unwatch_pid(c, pid);
ASSERT_NULL(manager_get_unit_by_pid(m, pid));
-
- return EXIT_SUCCESS;
}
static int intro(void) {
- log_show_color(true);
+ int r;
+
+ if (getuid() != 0)
+ return log_tests_skipped("not root");
+
+ r = enter_cgroup_subroot(NULL);
+ if (r < 0)
+ return log_tests_skipped_errno(r, "cgroupfs not available");
+
return EXIT_SUCCESS;
}