Skip to content

Fix GDBus test failures on non-Linux (in particular FreeBSD)

Simon McVittie requested to merge wip/smcv/gdbus-tests into master
  • gdbus-peer test: Improve diagnostics if g_rmdir fails

  • gdbus-peer test: Stop GDBusServer before tearing down temporary directory

    Otherwise, since !1193 (merged), the listening socket won't be deleted, and if we are not using abstract sockets (for example on *BSD), g_rmdir will fail with ENOTEMPTY.

    Fixes: 8e32b8e8 "gdbusserver: Delete socket and nonce file when stopping server"
    Resolves: #1921 (closed)

  • gdbus-peer test: Use unix:dir address if exact format doesn't matter

    Previously, we used unix:tmpdir, except in tests that verify that a particular address type works (notably unix:dir). Now we use unix:dir most of the time, and unix:tmpdir gets its own test instead.

    This helps to ensure that the tests continue to work on non-Linux Unix kernels, where abstract sockets do not exist and so unix:tmpdir is equivalent to unix:dir, even in the common case where the developer has only tried the test on Linux.

  • gdbus-server-auth test: Create temporary directory for Unix socket

    This avoids failure to listen on the given address on non-Linux Unix kernels, where abstract sockets do not exist and so unix:tmpdir is equivalent to unix:dir.

    To avoid bugs like this one recurring, run most of these tests using the unix:dir address type, where Linux is equivalent to other Unix kernels; just do one unix:tmpdir test, to check that we still interoperate with libdbus when using abstract sockets on Linux.

    Resolves: #1920 (closed)
    Fixes: 9f962ebe "Add a test for GDBusServer authentication"

Edited by Simon McVittie

Merge request reports