diff options
Diffstat (limited to 't')
-rw-r--r-- | t/.gitignore | 2 | ||||
-rw-r--r-- | t/924903.t | 31 | ||||
-rw-r--r-- | t/base/default/debian/changelog | 5 | ||||
-rw-r--r-- | t/base/default/debian/compat | 1 | ||||
-rw-r--r-- | t/base/default/debian/control | 11 | ||||
-rw-r--r-- | t/base/default/debian/rules | 4 | ||||
-rwxr-xr-x | t/base/default/debian/test.runscript | 3 |
7 files changed, 57 insertions, 0 deletions
diff --git a/t/.gitignore b/t/.gitignore new file mode 100644 index 0000000..02da7f6 --- /dev/null +++ b/t/.gitignore | |||
@@ -0,0 +1,2 @@ | |||
1 | */ | ||
2 | !base/ | ||
diff --git a/t/924903.t b/t/924903.t new file mode 100644 index 0000000..92ca4b0 --- /dev/null +++ b/t/924903.t | |||
@@ -0,0 +1,31 @@ | |||
1 | #!/usr/bin/perl | ||
2 | use strict; | ||
3 | use warnings; | ||
4 | use Test::More tests => 3; | ||
5 | use File::Path qw(remove_tree); | ||
6 | use File::Copy::Recursive qw(dircopy); | ||
7 | use File::stat; | ||
8 | |||
9 | sub prepare_source_package { | ||
10 | die '$0 does not match expected format' | ||
11 | unless ($0 =~ m#t/([0-9]+)\.t#); | ||
12 | my $number = $1; | ||
13 | my $srcdir = (-d "t/base/${number}") ? "t/base/${number}" : "t/base/default"; | ||
14 | my $testdir = "t/${number}"; | ||
15 | dircopy($srcdir, $testdir); | ||
16 | chdir($testdir); | ||
17 | return $testdir; | ||
18 | } | ||
19 | |||
20 | sub system_ok { | ||
21 | ok(system(@_) == 0, "external command @_"); | ||
22 | } | ||
23 | |||
24 | prepare_source_package(); | ||
25 | |||
26 | system_ok('dh_runit', 'debian/test.runscript', 'name=test'); | ||
27 | my $path = 'debian/dh-runit-test/var/lib/runit/supervise/test'; | ||
28 | ok(-d $path, 'supervise directory correctly created'); | ||
29 | my $info = stat($path); | ||
30 | my $mode = sprintf("%o", $info->mode & 0777); | ||
31 | is($mode, '700', 'supervise directory have conservative permissions'); | ||
diff --git a/t/base/default/debian/changelog b/t/base/default/debian/changelog new file mode 100644 index 0000000..94fbeaf --- /dev/null +++ b/t/base/default/debian/changelog | |||
@@ -0,0 +1,5 @@ | |||
1 | dh-runit-test (1.0) unstable; urgency=medium | ||
2 | |||
3 | * Initial release. | ||
4 | |||
5 | -- Dmitry Bogatov <KAction@debian.org> Wed, 20 Mar 2019 11:29:25 +0000 | ||
diff --git a/t/base/default/debian/compat b/t/base/default/debian/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/t/base/default/debian/compat | |||
@@ -0,0 +1 @@ | |||
11 | |||
diff --git a/t/base/default/debian/control b/t/base/default/debian/control new file mode 100644 index 0000000..a4629ca --- /dev/null +++ b/t/base/default/debian/control | |||
@@ -0,0 +1,11 @@ | |||
1 | Source: dh-runit-test | ||
2 | Section: devel | ||
3 | Priority: optional | ||
4 | Maintainer: Dmitry Bogatov <KAction@debian.org> | ||
5 | Build-Depends: dh-runit | ||
6 | Standards-Version: 4.3.0 | ||
7 | |||
8 | Package: dh-runit-test | ||
9 | Architecture: all | ||
10 | Depends: ${misc:Depends}, ${shlibs:Depends} | ||
11 | Descriptions: test package for dh_runit behaviour | ||
diff --git a/t/base/default/debian/rules b/t/base/default/debian/rules new file mode 100644 index 0000000..a57c3e7 --- /dev/null +++ b/t/base/default/debian/rules | |||
@@ -0,0 +1,4 @@ | |||
1 | #!/usr/bin/make -f | ||
2 | |||
3 | %: | ||
4 | dh $@ --with runit | ||
diff --git a/t/base/default/debian/test.runscript b/t/base/default/debian/test.runscript new file mode 100755 index 0000000..6f6aaea --- /dev/null +++ b/t/base/default/debian/test.runscript | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh -eu | ||
2 | echo 'I am dummy runscript!' | ||
3 | exec tail -f /dev/null | ||