summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/.gitignore2
-rw-r--r--t/924903.t31
-rw-r--r--t/base/default/debian/changelog5
-rw-r--r--t/base/default/debian/compat1
-rw-r--r--t/base/default/debian/control11
-rw-r--r--t/base/default/debian/rules4
-rwxr-xr-xt/base/default/debian/test.runscript3
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
2use strict;
3use warnings;
4use Test::More tests => 3;
5use File::Path qw(remove_tree);
6use File::Copy::Recursive qw(dircopy);
7use File::stat;
8
9sub 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
20sub system_ok {
21 ok(system(@_) == 0, "external command @_");
22}
23
24prepare_source_package();
25
26system_ok('dh_runit', 'debian/test.runscript', 'name=test');
27my $path = 'debian/dh-runit-test/var/lib/runit/supervise/test';
28ok(-d $path, 'supervise directory correctly created');
29my $info = stat($path);
30my $mode = sprintf("%o", $info->mode & 0777);
31is($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 @@
1dh-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 @@
1Source: dh-runit-test
2Section: devel
3Priority: optional
4Maintainer: Dmitry Bogatov <KAction@debian.org>
5Build-Depends: dh-runit
6Standards-Version: 4.3.0
7
8Package: dh-runit-test
9Architecture: all
10Depends: ${misc:Depends}, ${shlibs:Depends}
11Descriptions: 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
2echo 'I am dummy runscript!'
3exec tail -f /dev/null