dbus/test/internals
Simon McVittie f1faafd59b test: Skip TCP tests if getaddrinfo doesn't work
For example, this can be the case in bubblewrap or Debian pbuilder after
unsharing the network namespace:

    bwrap \
    --bind / / \
    --dev-bind /dev /dev \
    --bind /dev/shm /dev/shm \
    --bind /dev/pts /dev/pts \
    --unshare-net \
    ${builddir}/test/test-loopback --tap
    ...
    ok 1 /connect/tcp # SKIP Name resolution does not work here:
    getaddrinfo("127.0.0.1", "0", {flags=ADDRCONFIG, family=INET,
    socktype=STREAM, protocol=TCP}): Name or service not known

On some systems this can be circumvented by using nss_wrapper from
<https://cwrap.org/nss_wrapper.html>:

    cat > hosts <<EOF
    127.0.0.1 localhost
    EOF
    bwrap \
    ... \
    env \
    LD_PRELOAD=libnss_wrapper.so \
    NSS_WRAPPER_HOSTS=$(pwd)/hosts \
    ${builddir}/test/test-loopback --tap
    ...
    # listening at tcp:host=127.0.0.1,port=39219,family=ipv4,guid=...

but for systems where that does't work, we should be prepared to skip
the affected tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106812
2018-06-04 17:51:28 +01:00
..
printf.c Add more _DBUS_GNUC_PRINTF annotations 2016-11-10 11:46:33 +00:00
refs.c test: Test the same things with unix: that we do with tcp: 2018-06-04 17:51:23 +01:00
server-oom.c test: Skip TCP tests if getaddrinfo doesn't work 2018-06-04 17:51:28 +01:00
syslog.c internals: Decouple logging an error from exiting unsuccessfully 2017-07-05 13:12:37 +01:00
variant.c test_main_context_call_and_wait: Add 2017-11-24 12:19:15 +00:00