diff options
Diffstat (limited to 'src/libsystemd/sd-event/test-event.c')
-rw-r--r-- | src/libsystemd/sd-event/test-event.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/libsystemd/sd-event/test-event.c b/src/libsystemd/sd-event/test-event.c index 57dee392d7..6394507994 100644 --- a/src/libsystemd/sd-event/test-event.c +++ b/src/libsystemd/sd-event/test-event.c @@ -198,7 +198,7 @@ static int post_handler(sd_event_source *s, void *userdata) { return 2; } -static void test_basic_one(bool with_pidfd) { +TEST(basic) { sd_event *e = NULL; sd_event_source *w = NULL, *x = NULL, *y = NULL, *z = NULL, *q = NULL, *t = NULL; static const char ch = 'x'; @@ -207,10 +207,6 @@ static void test_basic_one(bool with_pidfd) { uint64_t event_now; int64_t priority; - log_info("/* %s(pidfd=%s) */", __func__, yes_no(with_pidfd)); - - assert_se(setenv("SYSTEMD_PIDFD", yes_no(with_pidfd), 1) >= 0); - assert_se(pipe(a) >= 0); assert_se(pipe(b) >= 0); assert_se(pipe(d) >= 0); @@ -301,13 +297,6 @@ static void test_basic_one(bool with_pidfd) { safe_close_pair(b); safe_close_pair(d); safe_close_pair(k); - - assert_se(unsetenv("SYSTEMD_PIDFD") >= 0); -} - -TEST(basic) { - test_basic_one(true); /* test with pidfd */ - test_basic_one(false); /* test without pidfd */ } TEST(sd_event_now) { @@ -583,13 +572,7 @@ TEST(pidfd) { assert_se(pid > 1); - pidfd = pidfd_open(pid, 0); - if (pidfd < 0) { - /* No pidfd_open() supported or blocked? */ - assert_se(ERRNO_IS_NOT_SUPPORTED(errno) || ERRNO_IS_PRIVILEGE(errno)); - (void) wait_for_terminate(pid, NULL); - return; - } + ASSERT_OK(pidfd = pidfd_open(pid, 0)); pid2 = fork(); if (pid2 == 0) |