summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2013-09-14 04:06:48 +0000
committerMichael Stapelberg <michael@stapelberg.de>2013-09-14 04:06:48 +0000
commit73d6f8a2143f3af90bc229eef8d7cb091f160a03 (patch)
treec4f9b1f7e65445f85f920a3838a5c4cab3deb3af
parente1d1e1212fb90c838c0cd674dfef816007da3e2d (diff)
downloadinit-system-helpers-73d6f8a2143f3af90bc229eef8d7cb091f160a03.tar.gz
tests: verify that masked services are not re-enabled
-rw-r--r--t/001-deb-systemd-helper.t13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/001-deb-systemd-helper.t b/t/001-deb-systemd-helper.t
index c38d176..c27408c 100644
--- a/t/001-deb-systemd-helper.t
+++ b/t/001-deb-systemd-helper.t
@@ -119,6 +119,19 @@ $retval = system("DPKG_MAINTSCRIPT_PACKAGE=test $dsh enable $random_unit");
isnt_enabled($random_unit);
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
+# ┃ Verify masking the service and running “enable” again does not ┃
+# ┃ re-create the symlinks. ┃
+# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
+
+symlink('/dev/null', $symlink_path);
+is(readlink($symlink_path), '/dev/null', 'service masked');
+is_debian_installed($random_unit);
+
+$retval = system("DPKG_MAINTSCRIPT_PACKAGE=test $dsh enable $random_unit");
+
+is(readlink($symlink_path), '/dev/null', 'service still masked');
+
+# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ Verify “disable” when purging deletes the statefile. ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛