summaryrefslogtreecommitdiff
path: root/src/test/test-install-root.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-07-25 10:20:16 -0400
committerLennart Poettering <lennart@poettering.net>2016-07-25 16:20:16 +0200
commitf777b4345e8c57e739bda746f78757d0fb136ac7 (patch)
tree8971ed52efe98a620ece89cdca83dfaccb29aaa7 /src/test/test-install-root.c
parent5ed020d8d10fc100c68edddb519f085b7397a45c (diff)
shared/install: allow "enable" on linked unit files (#3790)
User expectations are broken when "systemctl enable /some/path/service.service" behaves differently to "systemctl link ..." followed by "systemctl enable". From user's POV, "enable" with the full path just combines the two steps into one. Fixes #3010.
Diffstat (limited to 'src/test/test-install-root.c')
-rw-r--r--src/test/test-install-root.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/test-install-root.c b/src/test/test-install-root.c
index 4b9a74fca4..db1c928660 100644
--- a/src/test/test-install-root.c
+++ b/src/test/test-install-root.c
@@ -301,7 +301,12 @@ static void test_linked_units(const char *root) {
unit_file_changes_free(changes, n_changes);
changes = NULL; n_changes = 0;
- assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("linked3.service"), false, &changes, &n_changes) == -ELOOP);
+ assert_se(unit_file_enable(UNIT_FILE_SYSTEM, false, root, STRV_MAKE("linked3.service"), false, &changes, &n_changes) >= 0);
+ assert_se(n_changes == 1);
+ assert_se(changes[0].type == UNIT_FILE_SYMLINK);
+ assert_se(startswith(changes[0].path, root));
+ assert_se(endswith(changes[0].path, "linked3.service"));
+ assert_se(streq(changes[0].source, "/opt/linked3.service"));
unit_file_changes_free(changes, n_changes);
changes = NULL; n_changes = 0;
}