summaryrefslogtreecommitdiff
path: root/test/relay.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-06-04 16:27:49 +0100
committerSimon McVittie <smcv@collabora.com>2018-06-04 17:56:04 +0100
commitd0837e911d95851e5fc5067ad5b324316ec2666f (patch)
treed2b100a4ba807b2e28b0c290a2f412a5037ead64 /test/relay.c
parent102129f86a8d0f43e2d8002a46c8a6278e389e46 (diff)
downloaddbus-d0837e911d95851e5fc5067ad5b324316ec2666f.tar.gz
test: Test the same things with unix: that we do with tcp:
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 (cherry picked from commit cb7dd5bfccb2882d0e9951c41040ff6a97bb827d)
Diffstat (limited to 'test/relay.c')
-rw-r--r--test/relay.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/relay.c b/test/relay.c
index 00e7966a..5f905460 100644
--- a/test/relay.c
+++ b/test/relay.c
@@ -120,7 +120,7 @@ new_conn_cb (DBusServer *server,
static void
setup (Fixture *f,
- gconstpointer data G_GNUC_UNUSED)
+ gconstpointer address)
{
test_timeout_reset (1);
@@ -128,7 +128,7 @@ setup (Fixture *f,
dbus_error_init (&f->e);
g_queue_init (&f->messages);
- f->server = dbus_server_listen ("tcp:host=127.0.0.1", &f->e);
+ f->server = dbus_server_listen (address, &f->e);
assert_no_error (&f->e);
g_assert (f->server != NULL);
@@ -321,12 +321,21 @@ main (int argc,
{
test_init (&argc, &argv);
- g_test_add ("/connect", Fixture, NULL, setup,
+ g_test_add ("/connect/tcp", Fixture, "tcp:host=127.0.0.1", setup,
+ test_connect, teardown);
+ g_test_add ("/relay/tcp", Fixture, "tcp:host=127.0.0.1", setup,
+ test_relay, teardown);
+ g_test_add ("/limit/tcp", Fixture, "tcp:host=127.0.0.1", setup,
+ test_limit, teardown);
+
+#ifdef DBUS_UNIX
+ g_test_add ("/connect/unix", Fixture, "unix:tmpdir=/tmp", setup,
test_connect, teardown);
- g_test_add ("/relay", Fixture, NULL, setup,
+ g_test_add ("/relay/unix", Fixture, "unix:tmpdir=/tmp", setup,
test_relay, teardown);
- g_test_add ("/limit", Fixture, NULL, setup,
+ g_test_add ("/limit/unix", Fixture, "unix:tmpdir=/tmp", setup,
test_limit, teardown);
+#endif
return g_test_run ();
}