diff options
Diffstat (limited to 'src/test/test-watch-pid.c')
-rw-r--r-- | src/test/test-watch-pid.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/test/test-watch-pid.c b/src/test/test-watch-pid.c index cb43b35bc5..2c6ca0a1a2 100644 --- a/src/test/test-watch-pid.c +++ b/src/test/test-watch-pid.c @@ -13,25 +13,18 @@ int main(int argc, char *argv[]) { Unit *a, *b, *c, *u; int r; - log_set_max_level(LOG_DEBUG); - log_parse_environment(); - log_open(); - - if (getuid() != 0) { - log_notice("Not running as root, skipping kernel related tests."); - return EXIT_TEST_SKIP; - } + test_setup_logging(LOG_DEBUG); + if (getuid() != 0) + return log_tests_skipped("not root"); r = enter_cgroup_subroot(); - if (r == -ENOMEDIUM) { - log_notice("cgroupfs not available, skipping tests"); - return EXIT_TEST_SKIP; - } + if (r == -ENOMEDIUM) + return log_tests_skipped("cgroupfs not available"); - assert_se(set_unit_path(get_testdata_dir("")) >= 0); + assert_se(set_unit_path(get_testdata_dir()) >= 0); assert_se(runtime_dir = setup_fake_runtime_dir()); - assert_se(manager_new(UNIT_FILE_USER, true, &m) >= 0); + assert_se(manager_new(UNIT_FILE_USER, MANAGER_TEST_RUN_BASIC, &m) >= 0); assert_se(manager_startup(m, NULL, NULL) >= 0); assert_se(a = unit_new(m, sizeof(Service))); |