summaryrefslogtreecommitdiff
path: root/src/test/test-path-lookup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-25 02:32:19 +0100
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:30 +0200
commita14533430498bfaa91ba19b7fd0268bd2ef7d797 (patch)
treee68d2113d18cdfaa3bcfdf4a0289b0dd1108cfd8 /src/test/test-path-lookup.c
parentcd64fd56134ef00cce0651e741d4ebda3791d97b (diff)
core: rework logic to drop duplicate and non-existing items from search path
Move this into a function of its own, so that we can run it after we ran the generators, so that it takes into account removed generator dirs.
Diffstat (limited to 'src/test/test-path-lookup.c')
-rw-r--r--src/test/test-path-lookup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/test-path-lookup.c b/src/test/test-path-lookup.c
index 5575a364f2..5ee6f4ebb2 100644
--- a/src/test/test-path-lookup.c
+++ b/src/test/test-path-lookup.c
@@ -36,8 +36,8 @@ static void test_paths(UnitFileScope scope) {
assert_se(mkdtemp(template));
assert_se(unsetenv("SYSTEMD_UNIT_PATH") == 0);
- assert_se(lookup_paths_init(&lp_without_env, scope, NULL) == 0);
-
+ assert_se(lookup_paths_init(&lp_without_env, scope, NULL) >= 0);
+ assert_se(lookup_paths_reduce(&lp_without_env) >= 0);
assert_se(!strv_isempty(lp_without_env.search_path));
systemd_unit_path = strjoina(template, "/systemd-unit-path");
@@ -45,6 +45,8 @@ static void test_paths(UnitFileScope scope) {
assert_se(lookup_paths_init(&lp_with_env, scope, NULL) == 0);
assert_se(strv_length(lp_with_env.search_path) == 1);
assert_se(streq(lp_with_env.search_path[0], systemd_unit_path));
+ assert_se(lookup_paths_reduce(&lp_with_env) >= 0);
+ assert_se(strv_length(lp_with_env.search_path) == 0);
assert_se(rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0);
}