From dc34bb50e9906f0d8380ce01e2ee78d0007c506c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 25 Jul 2017 20:51:49 +0100 Subject: [PATCH] test/containers: Use a shorter path for XDG_RUNTIME_DIR Travis-CI uses a long enough path to the $builddir that appending what we do for the container pushes us over the length limit for AF_UNIX. Signed-off-by: Simon McVittie --- test/containers.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/test/containers.c b/test/containers.c index 39451e7e..c6d539d3 100644 --- a/test/containers.c +++ b/test/containers.c @@ -1543,6 +1543,25 @@ int main (int argc, char **argv) { + GError *error = NULL; + gchar *runtime_dir; + gchar *runtime_dbus_dir; + gchar *runtime_containers_dir; + gchar *runtime_services_dir; + int ret; + + runtime_dir = g_dir_make_tmp ("dbus-test-containers.XXXXXX", &error); + + if (runtime_dir == NULL) + g_error ("%s", error->message); + + g_setenv ("XDG_RUNTIME_DIR", runtime_dir, TRUE); + runtime_dbus_dir = g_build_filename (runtime_dir, "dbus-1", NULL); + runtime_containers_dir = g_build_filename (runtime_dir, "dbus-1", + "containers", NULL); + runtime_services_dir = g_build_filename (runtime_dir, "dbus-1", + "services", NULL); + test_init (&argc, &argv); g_test_add ("/containers/get-supported-arguments", Fixture, NULL, @@ -1582,5 +1601,11 @@ main (int argc, &limit_containers, setup, test_max_container_metadata_bytes, teardown); - return g_test_run (); + ret = g_test_run (); + + test_rmdir_if_exists (runtime_containers_dir); + test_rmdir_if_exists (runtime_services_dir); + test_rmdir_if_exists (runtime_dbus_dir); + test_rmdir_must_exist (runtime_dir); + return ret; } -- 2.13.3