diff options
Diffstat (limited to 'src/test/test-bpf-foreign-programs.c')
-rw-r--r-- | src/test/test-bpf-foreign-programs.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/test/test-bpf-foreign-programs.c b/src/test/test-bpf-foreign-programs.c index 35c7e0d..34ccb74 100644 --- a/src/test/test-bpf-foreign-programs.c +++ b/src/test/test-bpf-foreign-programs.c @@ -253,7 +253,7 @@ static int test_bpf_cgroup_programs(Manager *m, const char *unit_name, const Tes while (!IN_SET(SERVICE(u)->state, SERVICE_DEAD, SERVICE_FAILED)) { r = sd_event_run(m->event, UINT64_MAX); if (r < 0) - return log_error_errno(errno, "Event run failed %m"); + return log_error_errno(r, "Event run failed %m"); } cld_code = SERVICE(u)->exec_command[SERVICE_EXEC_START]->exec_status.code; @@ -282,7 +282,7 @@ int main(int argc, char *argv[]) { if (getuid() != 0) return log_tests_skipped("not running as root"); - assert_se(getrlimit(RLIMIT_MEMLOCK, &rl) >= 0); + ASSERT_OK(getrlimit(RLIMIT_MEMLOCK, &rl)); rl.rlim_cur = rl.rlim_max = MAX(rl.rlim_max, CAN_MEMLOCK_SIZE); (void) setrlimit_closest(RLIMIT_MEMLOCK, &rl); @@ -297,34 +297,34 @@ int main(int argc, char *argv[]) { if (r == -ENOMEDIUM) return log_tests_skipped("cgroupfs not available"); - assert_se(get_testdata_dir("units", &unit_dir) >= 0); - assert_se(set_unit_path(unit_dir) >= 0); + ASSERT_OK(get_testdata_dir("units", &unit_dir)); + ASSERT_OK(set_unit_path(unit_dir)); assert_se(runtime_dir = setup_fake_runtime_dir()); - assert_se(manager_new(RUNTIME_SCOPE_USER, MANAGER_TEST_RUN_BASIC, &m) >= 0); - assert_se(manager_startup(m, NULL, NULL, NULL) >= 0); + ASSERT_OK(manager_new(RUNTIME_SCOPE_USER, MANAGER_TEST_RUN_BASIC, &m)); + ASSERT_OK(manager_startup(m, NULL, NULL, NULL)); - assert_se(test_bpf_cgroup_programs(m, - "single_prog.service", single_prog, ELEMENTSOF(single_prog)) >= 0); - assert_se(test_bpf_cgroup_programs(m, + ASSERT_OK(test_bpf_cgroup_programs(m, + "single_prog.service", single_prog, ELEMENTSOF(single_prog))); + ASSERT_OK(test_bpf_cgroup_programs(m, "multi_prog_same_hook.service", - multi_prog_same_hook, ELEMENTSOF(multi_prog_same_hook)) >= 0); - assert_se(test_bpf_cgroup_programs(m, + multi_prog_same_hook, ELEMENTSOF(multi_prog_same_hook))); + ASSERT_OK(test_bpf_cgroup_programs(m, "same_prog_multi_hook.service", - same_prog_multi_hook, ELEMENTSOF(same_prog_multi_hook)) >= 0); - assert_se(test_bpf_cgroup_programs(m, + same_prog_multi_hook, ELEMENTSOF(same_prog_multi_hook))); + ASSERT_OK(test_bpf_cgroup_programs(m, "same_prog_multi_option_0.service", - same_prog_multi_option_0, ELEMENTSOF(same_prog_multi_option_0)) >= 0); - assert_se(test_bpf_cgroup_programs(m, + same_prog_multi_option_0, ELEMENTSOF(same_prog_multi_option_0))); + ASSERT_OK(test_bpf_cgroup_programs(m, "same_prog_multi_option_1.service", - same_prog_multi_option_1, ELEMENTSOF(same_prog_multi_option_1)) >= 0); - assert_se(test_bpf_cgroup_programs(m, + same_prog_multi_option_1, ELEMENTSOF(same_prog_multi_option_1))); + ASSERT_OK(test_bpf_cgroup_programs(m, "same_prog_same_hook.service", same_prog_same_hook, - ELEMENTSOF(same_prog_same_hook)) >= 0); - assert_se(test_bpf_cgroup_programs(m, + ELEMENTSOF(same_prog_same_hook))); + ASSERT_OK(test_bpf_cgroup_programs(m, "path_split_test.service", path_split_test, - ELEMENTSOF(path_split_test)) >= 0); + ELEMENTSOF(path_split_test))); return 0; } |