diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2019-11-16 19:39:49 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2019-11-16 19:40:38 +0300 |
commit | 1db0a96eb28faade39d4cef422e32f794291944e (patch) | |
tree | 38dc153d770b6803d45a9894ceca890ad528114a /t/dh_installsystemd | |
parent | 04978ba1e0d855d6161da70e22320bf84d47ff16 (diff) | |
parent | b1a9d1a622291373b7abc4eff2a6b2b2fef62083 (diff) | |
download | debhelper-1db0a96eb28faade39d4cef422e32f794291944e.tar.gz |
Merge https://salsa.debian.org/debian/debhelper
Diffstat (limited to 't/dh_installsystemd')
-rwxr-xr-x | t/dh_installsystemd/dh_installsystemd.t | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/t/dh_installsystemd/dh_installsystemd.t b/t/dh_installsystemd/dh_installsystemd.t index 7029c615..1faa1868 100755 --- a/t/dh_installsystemd/dh_installsystemd.t +++ b/t/dh_installsystemd/dh_installsystemd.t @@ -8,7 +8,7 @@ use Test::DH; use File::Path qw(remove_tree make_path); use Debian::Debhelper::Dh_Lib qw(!dirname); -plan(tests => 2); +plan(tests => 4); sub write_file { my ($path, $content) = @_; @@ -196,7 +196,9 @@ each_compat_subtest { unit_is_enabled('foo', 'source', 0); unit_is_enabled('foo', 'target', 1); ok(run_dh_tool('dh_clean')); +}; +each_compat_up_to_and_incl_subtest(11, sub { make_path('debian/foo/lib/systemd/system/'); make_path('debian/foo/etc/init.d/'); install_file('debian/foo.service', 'debian/foo/lib/systemd/system/target.service'); @@ -211,4 +213,20 @@ each_compat_subtest { unit_is_started('foo', 'source', 0); unit_is_started('foo', 'target', 0); ok(run_dh_tool('dh_clean')); -}; +}); + +each_compat_from_and_above_subtest(12, sub { + make_path('debian/foo/lib/systemd/system/'); + make_path('debian/foo/etc/init.d/'); + install_file('debian/foo.service', 'debian/foo/lib/systemd/system/target.service'); + make_symlink_raw_target('target.service', 'debian/foo/lib/systemd/system/source.service'); + write_file('debian/foo/etc/init.d/source', '# something'); + ok(run_dh_tool('dh_installsystemd')); + unit_is_enabled('foo', 'foo', 1); + # Alias= realized by symlinks are not enabled in maintaner scripts + unit_is_enabled('foo', 'source', 0); + unit_is_enabled('foo', 'target', 1); + unit_is_started('foo', 'source', 0); + unit_is_started('foo', 'target', 1); + ok(run_dh_tool('dh_clean')); +}); |