diff options
Diffstat (limited to 't/924903.t')
-rw-r--r-- | t/924903.t | 31 |
1 files changed, 31 insertions, 0 deletions
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'); | ||