diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 16:37:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-17 16:37:30 +0000 |
commit | dbf14b11a1c911e6832e5518ae9c3e406245edaa (patch) | |
tree | f2b58ca7d37f97bf2c49862a31951aa103c06b12 /t/dh_installsystemd | |
parent | Releasing progress-linux version 13.15.3-0.0~progress7.99u1. (diff) | |
download | debhelper-dbf14b11a1c911e6832e5518ae9c3e406245edaa.tar.xz debhelper-dbf14b11a1c911e6832e5518ae9c3e406245edaa.zip |
Merging upstream version 13.16.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/dh_installsystemd')
-rwxr-xr-x | t/dh_installsystemd/dh_installsystemd_tmpfiles.t | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/dh_installsystemd/dh_installsystemd_tmpfiles.t b/t/dh_installsystemd/dh_installsystemd_tmpfiles.t index 1041ebe..c91a97b 100755 --- a/t/dh_installsystemd/dh_installsystemd_tmpfiles.t +++ b/t/dh_installsystemd/dh_installsystemd_tmpfiles.t @@ -68,8 +68,24 @@ each_compat_from_and_above_subtest(13, sub { each_compat_from_and_above_subtest(13, sub { + my ($compat) = @_; + make_path('debian/foo/usr/lib/tmpfiles.d'); create_empty_file('debian/foo/usr/lib/tmpfiles.d/foo.conf'); + + my $purge_file = <<END; +# Some comment + +d /tmp/somedir +f /tmp/somedir/somefile - - - - baz +d /tmp/otherdir +R /tmp/yetotherdir +END + + open(my $fd, '>', 'debian/foo/usr/lib/tmpfiles.d/bar.conf') or error("open(bar.conf) failed: $!"); + print $fd $purge_file; + close($fd) or error("close(bar.conf) failed: $!"); + ok(run_dh_tool('dh_installtmpfiles')); # dh_installtmpfiles do not install services ok(!-e "debian/foo/etc/init.d/foo"); @@ -84,5 +100,25 @@ each_compat_from_and_above_subtest(13, sub { ok(! grep { m/(?:invoke|update)-rc.d|deb-systemd-invoke/ } @{$snippet}); ok(grep { m/systemd-tmpfiles/ } @{$snippet}); } + + my @postrm = find_script('foo', 'postrm'); + if ($compat <= 13) { + # No factory reset on compat 13 + is(scalar(@postrm), 0); + } else { + # We should have an inlined snippets for removal/purge + is(scalar(@postrm), 1); + if (scalar(@postrm) == 1) { + open(my $fd, '<', $postrm[0]) or error("open($postrm[0]) failed: $!"); + my $snippet = readlines($fd); + close($fd); + ok(grep { m/# Some comment/ } @{$snippet}); + ok(grep { m/d \/tmp\/somedir/ } @{$snippet}); + ok(grep { m/f \/tmp\/somedir\/somefile - - - - baz/ } @{$snippet}); + ok(grep { m/d \/tmp\/otherdir/ } @{$snippet}); + ok(grep { m/R \/tmp\/yetotherdir/ } @{$snippet}); + } + } + ok(run_dh_tool('dh_clean')); }); |