diff options
author | Niels Thykier <niels@thykier.net> | 2018-01-28 21:04:24 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2018-01-28 21:13:22 +0000 |
commit | a15dba1b8f9e17ffc5b31364e12f54d0fd0684e3 (patch) | |
tree | a406e4cad72d9e806a5b7e625ee763f8cb6ff277 /t/dh_installsystemd | |
parent | 4692a8d4b344aae0165d8ad1bf2e80c68edfcb6e (diff) | |
download | debhelper-a15dba1b8f9e17ffc5b31364e12f54d0fd0684e3.tar.gz |
Rely on DEB_RULES_REQUIRES_ROOT for R³ support
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 't/dh_installsystemd')
-rwxr-xr-x | t/dh_installsystemd/dh_installsystemd.t | 22 | ||||
-rwxr-xr-x | t/dh_installsystemd/dh_installsystemd_tmpfiles.t | 4 | ||||
-rwxr-xr-x | t/dh_installsystemd/dh_systemd.t | 30 |
3 files changed, 28 insertions, 28 deletions
diff --git a/t/dh_installsystemd/dh_installsystemd.t b/t/dh_installsystemd/dh_installsystemd.t index 50e737de..1273e01f 100755 --- a/t/dh_installsystemd/dh_installsystemd.t +++ b/t/dh_installsystemd/dh_installsystemd.t @@ -55,7 +55,7 @@ sub unit_is_started { # Units are installed and enabled each_compat_subtest { - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd')); + ok(run_dh_tool( 'dh_installsystemd')); ok(-e "debian/foo/lib/systemd/system/foo.service"); ok(find_script('foo', 'postinst')); unit_is_enabled('foo', 'foo', 1); @@ -66,7 +66,7 @@ each_compat_subtest { make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo2.service', 'debian/foo/lib/systemd/system/foo2.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd')); + ok(run_dh_tool('dh_installsystemd')); ok(-e "debian/foo/lib/systemd/system/foo.service"); ok(find_script('foo', 'postinst')); unit_is_enabled('foo', 'foo', 1); @@ -77,7 +77,7 @@ each_compat_subtest { make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo2.service', 'debian/foo/lib/systemd/system/foo2.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd', '--no-start')); + ok(run_dh_tool('dh_installsystemd', '--no-start')); ok(-e "debian/foo/lib/systemd/system/foo.service"); ok(find_script('foo', 'postinst')); unit_is_enabled('foo', 'foo', 1); @@ -88,8 +88,8 @@ each_compat_subtest { make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo2.service', 'debian/foo/lib/systemd/system/foo2.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd', '--no-start', 'debian/foo.service')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd', '-p', 'foo', 'foo2.service')); + ok(run_dh_tool('dh_installsystemd', '--no-start', 'debian/foo.service')); + ok(run_dh_tool('dh_installsystemd', '-p', 'foo', 'foo2.service')); ok(-e "debian/foo/lib/systemd/system/foo.service"); ok(find_script('foo', 'postinst')); unit_is_enabled('foo', 'foo', 1); @@ -100,8 +100,8 @@ each_compat_subtest { make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo2.service', 'debian/foo/lib/systemd/system/foo2.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd', '--no-enable', 'debian/foo.service')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd', '-p', 'foo', 'foo2.service')); + ok(run_dh_tool('dh_installsystemd', '--no-enable', 'debian/foo.service')); + ok(run_dh_tool('dh_installsystemd', '-p', 'foo', 'foo2.service')); ok(-e "debian/foo/lib/systemd/system/foo.service"); ok(find_script('foo', 'postinst')); unit_is_enabled('foo', 'foo', 0, 1); # Disabled units are still masked on removal @@ -111,7 +111,7 @@ each_compat_subtest { ok(run_dh_tool('dh_clean')); make_path('debian/foo/lib/systemd/system/'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd', '--no-restart-after-upgrade')); + ok(run_dh_tool('dh_installsystemd', '--no-restart-after-upgrade')); my @foo_postinst = find_script('foo', 'postinst'); ok(@foo_postinst); my $matches = @foo_postinst ? grep { m{deb-systemd-invoke start .*foo.service} } `cat @foo_postinst` : -1; @@ -121,7 +121,7 @@ each_compat_subtest { # Quoting #764730 make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo.service', 'debian/foo/lib/systemd/system/foo\x2dfuse.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd')); + ok(run_dh_tool('dh_installsystemd')); unit_is_enabled('foo', 'foo\x2dfuse', 1); unit_is_started('foo', 'foo\x2dfuse', 1); ok(run_dh_tool('dh_clean')); @@ -129,12 +129,12 @@ each_compat_subtest { # --name flag #870768 make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo2.service', 'debian/foo/lib/systemd/system/foo2.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd', '--name=foo')); + ok(run_dh_tool('dh_installsystemd', '--name=foo')); unit_is_enabled('foo', 'foo', 1); unit_is_started('foo', 'foo', 1); unit_is_enabled('foo', 'foo2', 0); unit_is_started('foo', 'foo2', 0); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd', '--name=foo2')); + ok(run_dh_tool('dh_installsystemd', '--name=foo2')); unit_is_enabled('foo', 'foo', 1); unit_is_started('foo', 'foo', 1); unit_is_enabled('foo', 'foo2', 1); diff --git a/t/dh_installsystemd/dh_installsystemd_tmpfiles.t b/t/dh_installsystemd/dh_installsystemd_tmpfiles.t index 9934dac5..b2ac60b6 100755 --- a/t/dh_installsystemd/dh_installsystemd_tmpfiles.t +++ b/t/dh_installsystemd/dh_installsystemd_tmpfiles.t @@ -25,8 +25,8 @@ if (uid_0_test_is_ok()) { each_compat_from_and_above_subtest(11, sub { make_path('debian/foo/usr/lib/tmpfiles.d'); create_empty_file('debian/foo/usr/lib/tmpfiles.d/foo.conf'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installinit')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_installsystemd')); + ok(run_dh_tool('dh_installinit')); + ok(run_dh_tool('dh_installsystemd')); ok(-e "debian/foo/etc/init.d/foo"); ok(-e "debian/foo/lib/systemd/system/foo.service"); my @postinst = find_script('foo', 'postinst'); diff --git a/t/dh_installsystemd/dh_systemd.t b/t/dh_installsystemd/dh_systemd.t index 18f2f487..49850431 100755 --- a/t/dh_installsystemd/dh_systemd.t +++ b/t/dh_installsystemd/dh_systemd.t @@ -51,8 +51,8 @@ sub unit_is_started { # Units are installed and enabled each_compat_up_to_and_incl_subtest(10, sub { - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_enable')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_start')); + ok(run_dh_tool('dh_systemd_enable')); + ok(run_dh_tool('dh_systemd_start')); ok(-e "debian/foo/lib/systemd/system/foo.service"); ok(-e "debian/foo.postinst.debhelper"); unit_is_enabled('foo', 'foo', 1); @@ -63,8 +63,8 @@ each_compat_up_to_and_incl_subtest(10, sub { make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo2.service', 'debian/foo/lib/systemd/system/foo2.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_enable')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_start')); + ok(run_dh_tool('dh_systemd_enable')); + ok(run_dh_tool('dh_systemd_start')); ok(-e "debian/foo/lib/systemd/system/foo.service"); ok(-e "debian/foo.postinst.debhelper"); unit_is_enabled('foo', 'foo', 1); @@ -75,8 +75,8 @@ each_compat_up_to_and_incl_subtest(10, sub { make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo2.service', 'debian/foo/lib/systemd/system/foo2.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_enable')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_start', '--no-start')); + ok(run_dh_tool('dh_systemd_enable')); + ok(run_dh_tool('dh_systemd_start', '--no-start')); ok(-e "debian/foo/lib/systemd/system/foo.service"); ok(-e "debian/foo.postinst.debhelper"); unit_is_enabled('foo', 'foo', 1); @@ -87,9 +87,9 @@ each_compat_up_to_and_incl_subtest(10, sub { make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo2.service', 'debian/foo/lib/systemd/system/foo2.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_enable')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_start', '--no-start', 'debian/foo.service')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_start', '-p', 'foo', 'foo2.service')); + ok(run_dh_tool('dh_systemd_enable')); + ok(run_dh_tool('dh_systemd_start', '--no-start', 'debian/foo.service')); + ok(run_dh_tool('dh_systemd_start', '-p', 'foo', 'foo2.service')); ok(-e "debian/foo/lib/systemd/system/foo.service"); ok(-e "debian/foo.postinst.debhelper"); unit_is_enabled('foo', 'foo', 1); @@ -100,9 +100,9 @@ each_compat_up_to_and_incl_subtest(10, sub { make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo2.service', 'debian/foo/lib/systemd/system/foo2.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_enable', '--no-enable', 'debian/foo.service')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_enable', '-p', 'foo', 'foo2.service')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_start')); + ok(run_dh_tool('dh_systemd_enable', '--no-enable', 'debian/foo.service')); + ok(run_dh_tool('dh_systemd_enable', '-p', 'foo', 'foo2.service')); + ok(run_dh_tool('dh_systemd_start')); ok(-e "debian/foo/lib/systemd/system/foo.service"); ok(-e "debian/foo.postinst.debhelper"); unit_is_enabled('foo', 'foo', 0, 1); # Disabled units are still masked on removal @@ -113,7 +113,7 @@ each_compat_up_to_and_incl_subtest(10, sub { make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo.service', 'debian/foo/lib/systemd/system/foo.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_start', '--no-restart-after-upgrade')); + ok(run_dh_tool('dh_systemd_start', '--no-restart-after-upgrade')); my $matches = grep { m{deb-systemd-invoke start .*foo.service} } `cat debian/foo.postinst.debhelper`; ok($matches == 1); ok(run_dh_tool('dh_clean')); @@ -121,8 +121,8 @@ each_compat_up_to_and_incl_subtest(10, sub { # Quoting #764730 make_path('debian/foo/lib/systemd/system/'); install_file('debian/foo.service', 'debian/foo/lib/systemd/system/foo\x2dfuse.service'); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_enable')); - ok(run_dh_tool({ 'needs_root' => 1 }, 'dh_systemd_start')); + ok(run_dh_tool('dh_systemd_enable')); + ok(run_dh_tool('dh_systemd_start')); unit_is_enabled('foo', 'foo\x2dfuse', 1); unit_is_started('foo', 'foo\x2dfuse', 1); ok(run_dh_tool('dh_clean')); |