summaryrefslogtreecommitdiff
path: root/t/dh_installsystemd
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2018-01-14 10:22:37 +0000
committerNiels Thykier <niels@thykier.net>2018-01-14 10:22:37 +0000
commit685618e990559e95720681a67f542193544cdb9f (patch)
treed7654a29ab8b175bb5a9abcfd311a38667da5615 /t/dh_installsystemd
parentf0da234984b28bbaea297c643cfaa6714f0c4a79 (diff)
downloaddebhelper-685618e990559e95720681a67f542193544cdb9f.tar.gz
Update test to match previous commit
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 't/dh_installsystemd')
-rwxr-xr-xt/dh_installsystemd/dh_installsystemd.t5
-rwxr-xr-xt/dh_installsystemd/dh_systemd.t5
2 files changed, 8 insertions, 2 deletions
diff --git a/t/dh_installsystemd/dh_installsystemd.t b/t/dh_installsystemd/dh_installsystemd.t
index a33a8359..50e737de 100755
--- a/t/dh_installsystemd/dh_installsystemd.t
+++ b/t/dh_installsystemd/dh_installsystemd.t
@@ -28,7 +28,10 @@ sub unit_is_enabled {
$num_masks = $num_masks // $num_enables;
my @postinst_snippets = find_script($package, 'postinst');
@output=`cat @postinst_snippets` if @postinst_snippets;
- $matches = grep { m{^if deb-systemd-helper .* was-enabled .*'\Q$unit\E\.service'} } @output;
+ # Match exactly one tab; the "dont-enable" script has an "enable"
+ # line for re-enabling the service if the admin had it enabled.
+ # But we do not want to include that in our count.
+ $matches = grep { m{^\tif deb-systemd-helper .* was-enabled .*'\Q$unit\E\.service'} } @output;
ok($matches == $num_enables) or diag("$unit appears to have been enabled $matches times (expected $num_enables)");
my @postrm_snippets = find_script($package, 'postrm');
@output=`cat @postrm_snippets` if @postrm_snippets;
diff --git a/t/dh_installsystemd/dh_systemd.t b/t/dh_installsystemd/dh_systemd.t
index dee70965..18f2f487 100755
--- a/t/dh_installsystemd/dh_systemd.t
+++ b/t/dh_installsystemd/dh_systemd.t
@@ -27,7 +27,10 @@ sub unit_is_enabled {
my $matches;
$num_masks = $num_masks // $num_enables;
@output=`cat debian/$package.postinst.debhelper`;
- $matches = grep { m{^if deb-systemd-helper .* was-enabled .*'\Q$unit\E\.service'} } @output;
+ # Match exactly one tab; the "dont-enable" script has an "enable"
+ # line for re-enabling the service if the admin had it enabled.
+ # But we do not want to include that in our count.
+ $matches = grep { m{^\tif deb-systemd-helper .* was-enabled .*'\Q$unit\E\.service'} } @output;
ok($matches == $num_enables) or diag("$unit appears to have been enabled $matches times (expected $num_enables)");
@output=`cat debian/$package.postrm.debhelper`;
$matches = grep { m{deb-systemd-helper mask.*'\Q$unit\E\.service'} } @output;