summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-07 18:48:01 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:32 +0200
commit4943d14306c3e456525fdb793e7f48efea5b9236 (patch)
tree01ebe6e1d8ff0563f279d45e78c8ddfc0723a164 /src/test
parenta69b4fb0f80689b96f492a557368ed880365edee (diff)
systemctl: don't confuse sysv code with generated units
The SysV compat code checks whether there's a native unit file before looking for a SysV init script. Since the newest rework generated units will show up in the unit path, and hence the checks ended up assuming that there always was a native unit file for each init script: the generated one. With this change the generated unit file directory is suppressed from the search path when this check is done, to avoid the confusion.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-path-lookup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-path-lookup.c b/src/test/test-path-lookup.c
index ba60482867..096326d176 100644
--- a/src/test/test-path-lookup.c
+++ b/src/test/test-path-lookup.c
@@ -36,13 +36,13 @@ 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, 0, NULL) >= 0);
assert_se(!strv_isempty(lp_without_env.search_path));
assert_se(lookup_paths_reduce(&lp_without_env) >= 0);
systemd_unit_path = strjoina(template, "/systemd-unit-path");
assert_se(setenv("SYSTEMD_UNIT_PATH", systemd_unit_path, 1) == 0);
- assert_se(lookup_paths_init(&lp_with_env, scope, NULL) == 0);
+ assert_se(lookup_paths_init(&lp_with_env, scope, 0, 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);