diff options
author | Niels Thykier <niels@thykier.net> | 2018-01-14 10:22:37 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2018-01-14 10:22:37 +0000 |
commit | 685618e990559e95720681a67f542193544cdb9f (patch) | |
tree | d7654a29ab8b175bb5a9abcfd311a38667da5615 /t/dh_installsystemd | |
parent | f0da234984b28bbaea297c643cfaa6714f0c4a79 (diff) | |
download | debhelper-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-x | t/dh_installsystemd/dh_installsystemd.t | 5 | ||||
-rwxr-xr-x | t/dh_installsystemd/dh_systemd.t | 5 |
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; |