summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2014-11-10 12:49:47 +1300
committerRobert Ancell <robert.ancell@canonical.com>2014-11-10 12:49:47 +1300
commit98778683a05c3a27902309763ed27cb473ef6c05 (patch)
tree88bcdc7bfcb154d323b28b65da0f4b7ad2cbbc4d
parent490bbc43ae05c0ae7fcac9fd781ffa899634930a (diff)
downloadlightdm-git-98778683a05c3a27902309763ed27cb473ef6c05.tar.gz
Correctly mock /run in tests so Mir tests don't collide with system files
-rw-r--r--tests/src/libsystem.c3
-rw-r--r--tests/src/test-runner.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/src/libsystem.c b/tests/src/libsystem.c
index d83a954d..0510c9a5 100644
--- a/tests/src/libsystem.c
+++ b/tests/src/libsystem.c
@@ -196,6 +196,9 @@ redirect_path (const gchar *path)
if (g_str_has_prefix (path, "/tmp"))
return g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "tmp", path + strlen ("/tmp"), NULL);
+ if (g_str_has_prefix (path, "/run"))
+ return g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "run", path + strlen ("/run"), NULL);
+
if (g_str_has_prefix (path, "/etc/xdg"))
return g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "etc", "xdg", path + strlen ("/etc/xdg"), NULL);
diff --git a/tests/src/test-runner.c b/tests/src/test-runner.c
index dc12d475..abad4865 100644
--- a/tests/src/test-runner.c
+++ b/tests/src/test-runner.c
@@ -2535,6 +2535,7 @@ main (int argc, char **argv)
/* Set up a skeleton file system */
g_mkdir_with_parents (g_strdup_printf ("%s/etc", temp_dir), 0755);
+ g_mkdir_with_parents (g_strdup_printf ("%s/run", temp_dir), 0755);
g_mkdir_with_parents (g_strdup_printf ("%s/usr/share", temp_dir), 0755);
g_mkdir_with_parents (g_strdup_printf ("%s/usr/share/lightdm/sessions", temp_dir), 0755);
g_mkdir_with_parents (g_strdup_printf ("%s/usr/share/lightdm/remote-sessions", temp_dir), 0755);