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:51:23 +0100
commitcb7dd5bfccb2882d0e9951c41040ff6a97bb827d (patch)
tree7f74e7e768ac2ff7237485753b6e2bea5ffd7f4f /test/relay.c
parentb19c9e2f265878801bc48866a7cc3152ca2ad45e (diff)
downloaddbus-cb7dd5bfccb2882d0e9951c41040ff6a97bb827d.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
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 ();
}