summaryrefslogtreecommitdiff
path: root/src/test/test-path-lookup.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-09-13 16:37:33 +0900
committerLennart Poettering <lennart@poettering.net>2018-09-13 12:13:54 +0200
commit2b8b1056d926440e2e1b58ffe25012445031dac5 (patch)
treee1a3157df29a26d3ac8ef56f8930860cb05ae928 /src/test/test-path-lookup.c
parentc633b0a64270d67754c243c6b9d2ed155dbd8e30 (diff)
downloadsystemd-2b8b1056d926440e2e1b58ffe25012445031dac5.tar.gz
test: unset $XDG_{CONFIG,DATA}_DIRS
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.
Diffstat (limited to 'src/test/test-path-lookup.c')
-rw-r--r--src/test/test-path-lookup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/test-path-lookup.c b/src/test/test-path-lookup.c
index 892293cb10..d6ea659d1d 100644
--- a/src/test/test-path-lookup.c
+++ b/src/test/test-path-lookup.c
@@ -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);