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.
This commit is contained in:
Yu Watanabe
2018-09-13 12:13:54 +02:00
committed by Lennart Poettering
parent c633b0a642
commit 2b8b1056d9
+2
View 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);