On OBS the build VM is heavily locked down, with network
disabled in various ways in the custom kernel, to isolate the
build, including disabling CONFIG_UNIX_DIAG.
[ 456s] /* test_af_unix_get_qlen */
[ 456s] src/test/test-socket-netlink.c:393: Assertion failed: Expected "af_unix_get_qlen(unix_fd, &q)" to succeed, but got error: No such file or directory
[ 454s] /* test_sock_diag_unix */
[ 454s] src/libsystemd/sd-netlink/test-netlink.c:727: Assertion failed: Expected "sd_netlink_call(nl, message, 0, &reply)" to succeed, but got error: No such file or directory
Follow-up for
89e546e927b8d1fb6b7d44d689586f949109f144
Follow-up for
4a3bf440f26c0577808c16da84a57f731c48eaeb
TEST(sock_diag_unix) {
_cleanup_(sd_netlink_unrefp) sd_netlink *nl = NULL;
+ int r;
ASSERT_OK(sd_sock_diag_socket_open(&nl));
ASSERT_OK(sd_sock_diag_message_new_unix(nl, &message, st.st_ino, cookie, UDIAG_SHOW_RQLEN));
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *reply = NULL;
- ASSERT_OK(sd_netlink_call(nl, message, /* usec= */ 0, &reply));
+ r = sd_netlink_call(nl, message, /* usec= */ 0, &reply);
+ if (r == -ENOENT)
+ return (void) log_tests_skipped("CONFIG_UNIX_DIAG disabled");
+ ASSERT_OK(r);
}
DEFINE_TEST_MAIN(LOG_DEBUG);
}
TEST(af_unix_get_qlen) {
+ int r;
_cleanup_close_ int unix_fd = ASSERT_FD(socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0));
ASSERT_OK(socket_autobind(unix_fd, /* ret_name= */ NULL));
ASSERT_OK_ERRNO(listen(unix_fd, 123));
uint32_t q;
- ASSERT_OK(af_unix_get_qlen(unix_fd, &q));
+ r = af_unix_get_qlen(unix_fd, &q);
+ if (r == -ENOENT)
+ return (void) log_tests_skipped("CONFIG_UNIX_DIAG disabled");
+ ASSERT_OK(r);
ASSERT_EQ(q, 0U);
_cleanup_close_ int conn_fd = ASSERT_FD(socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0));