]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: unset $XDG_{CONFIG,DATA}_DIRS
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 13 Sep 2018 07:37:33 +0000 (16:37 +0900)
committerLennart Poettering <lennart@poettering.net>
Thu, 13 Sep 2018 10:13:54 +0000 (12:13 +0200)
When $XDG_DATA_DIRS is unset, then, the default value
'/usr/local/share:/usr/share' is used.
When $XDG_DATA_DIRS contain the default paths but the order
is inverted: '/usr/share:/usr/local/share', then test-path-lookup fails.

Fixes #10002.

src/test/test-path-lookup.c

index 892293cb10e91d52ab94d1e5fae1ae8fedc65f1a..d6ea659d1db4f0bc2da053f5e863304a3b4c1e89 100644 (file)
@@ -40,6 +40,8 @@ static void test_user_and_global_paths(void) {
         unsigned k = 0;
 
         assert_se(unsetenv("SYSTEMD_UNIT_PATH") == 0);
+        assert_se(unsetenv("XDG_DATA_DIRS") == 0);
+        assert_se(unsetenv("XDG_CONFIG_DIRS") == 0);
 
         assert_se(lookup_paths_init(&lp_global, UNIT_FILE_GLOBAL, 0, NULL) == 0);
         assert_se(lookup_paths_init(&lp_user, UNIT_FILE_USER, 0, NULL) == 0);