summaryrefslogtreecommitdiff
path: root/test/relay.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: Call dbus_shutdown()Simon McVittie2018-08-021-1/+5
| | | | | | | | | | Not all of these tests will be fully valgrind-clean yet (or perhaps ever), but it's easier to add this to all of them than to think about it. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194
* tests: Detach server from main loop during teardownSimon McVittie2018-08-021-1/+1
| | | | | | | | | | | test_server_setup() takes a reference to the DBusServer, so we need to release that ref by calling test_server_shutdown(). test_server_shutdown() also disconnects the server, so we don't need to do that. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194
* test: Skip TCP tests if getaddrinfo doesn't workSimon McVittie2018-06-041-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* test: Test the same things with unix: that we do with tcp:Simon McVittie2018-06-041-5/+14
| | | | | | | | | | | | | | Minimal autobuilder environments don't always have working TCP, so we may need to skip TCP tests. Make sure we test the equivalent code paths via Unix sockets in those environments. One notable exception is test/fdpass.c, which uses TCP as a transport that is known not to be able to carry Unix fds; this needs to continue to use TCP. 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
* tests: Add the ability to multiply up test timeoutsSimon McVittie2017-12-041-1/+1
| | | | | | | | Tests that brute-force OOM code paths can be rather slow. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100317 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: In slower tests, make the timeout per-test-caseSimon McVittie2017-09-271-0/+2
| | | | | | | | | | | | | | | Some test-cases in the dbus-daemon and relay tests spam the bus with thousands of messages, which can take 25 seconds on slower CPUs like MIPS. Similarly, the refs test spams millions of refcount operations, which it appears might take more than a minute on PA-RISC (HPPA). To get an idea of how close we are to having a problem on other architectures, log a message and start a timer when we reset the timeout in setup(), and log the elapsed time when we reach teardown(). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103009 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com>
* tests: avoid noise on stdout when not --verboseSimon McVittie2015-04-161-3/+3
| | | | | | | | | | | This makes life easier for frameworks like LAVA that screen-scrape test results. g_test_message() is not displayed by default, but each test can be run with either --tap or --verbose to get these messages displayed. Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89846
* Merge branch 'dbus-1.8'Ralf Habacker2015-04-131-0/+4
|\ | | | | | | | | Conflicts: dbus/dbus-sysdeps-win.c
| * Fix 'dbus connection referencing issue in test-relay'.Ralf Habacker2015-04-131-0/+4
| | | | | | | | | | | | | | The watches added on connection setup should be removed on shutdown. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90005 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | Add a common test_init() for GLib tests which prevents hanging foreverSimon McVittie2015-02-041-3/+2
|/ | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* Tests: allow dbus-glib to be replaced with use of libdbus-internalSimon McVittie2013-09-031-10/+15
| | | | | | | | | | | | | | | | | | | | | | We only use dbus-glib for its main loop; within dbus, DBusLoop is available as an alternative, although it isn't thread-safe and isn't public API. For tests that otherwise only use libdbus public API, it's desirable to be able to avoid DBusLoop, so we can run them against an installed libdbus as an integration test. However, if we don't have dbus-glib, we're going to have to use an in-tree main loop, which might as well be DBusLoop. The major disadvantage of using dbus-glib is that it isn't safe to link both dbus-1 and dbus-internal at the same time. This is awkward for a future test case that wants to use _dbus_getsid() in dbus-daemon.c, but only on Windows (fd.o #54445). If we use the same API wrapper around both dbus-glib and DBusLoop, we can compile that test against dbus-glib or against DBusLoop, depending on the platform. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* relay test: don't leak the server's addressSimon McVittie2011-08-051-4/+8
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39836 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
* Fix copyright datesSimon McVittie2011-06-101-1/+1
| | | | | Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570
* Attempt to reproduce fd.o #34393 via another regression testSimon McVittie2011-06-101-0/+318
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34570