From: Luca Boccassi Date: Fri, 20 Mar 2026 00:43:26 +0000 (+0000) Subject: test: skip D-Bus FD truncation test with dbus-daemon X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69c087bade610f85cb8f9ebeae587e8a4aaa5007;p=thirdparty%2Fsystemd.git test: skip D-Bus FD truncation test with dbus-daemon dbus-daemon intentionally disconnects peers when FDs get truncated. Detect it and skip it in that case, as the purpose of the test is not to exercise the D-Bus implementation, but our library. When running with dbus-broker (Fedora, etc) we'll get full coverage. Fixes https://github.com/systemd/systemd/issues/41150 Follow-up for 744d589632c545e90ae76853abbfbc90cb530e24 --- diff --git a/src/libsystemd/sd-bus/test-bus-chat.c b/src/libsystemd/sd-bus/test-bus-chat.c index 3544b4580b7..1f358ccd339 100644 --- a/src/libsystemd/sd-bus/test-bus-chat.c +++ b/src/libsystemd/sd-bus/test-bus-chat.c @@ -567,11 +567,17 @@ TEST(ctrunc) { /* The very first message should be the one we expect */ ASSERT_OK(get_one_message(bus, &recvd)); - ASSERT_TRUE(sd_bus_message_is_method_call(recvd, "org.freedesktop.systemd.test", "SendFds")); /* This needs to succeed or the following tests are going to be unhappy... */ ASSERT_EQ(setrlimit(RLIMIT_NOFILE, &orig_rl), 0); + /* dbus-daemon disconnects peers when FDs get truncated + * https://github.com/systemd/systemd/issues/41150 */ + if (sd_bus_message_is_signal(recvd, "org.freedesktop.DBus.Local", "Disconnected") > 0) + return (void) log_tests_skipped("Running with dbus-daemon, which doesn't support fd passing with truncation"); + + ASSERT_TRUE(sd_bus_message_is_method_call(recvd, "org.freedesktop.systemd.test", "SendFds")); + /* Try to read all the fds. We expect at least one to fail with -EBADMSG due to * truncation, and all subsequent reads must also fail with -EBADMSG. */ int i;