summaryrefslogtreecommitdiffstats
path: root/t/recipes/checks/systemd/init.d-general
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:42:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:42:30 +0000
commit75808db17caf8b960b351e3408e74142f4c85aac (patch)
tree7989e9c09a4240248bf4658a22208a0a52d991c4 /t/recipes/checks/systemd/init.d-general
parentInitial commit. (diff)
downloadlintian-75808db17caf8b960b351e3408e74142f4c85aac.tar.xz
lintian-75808db17caf8b960b351e3408e74142f4c85aac.zip
Adding upstream version 2.117.0.upstream/2.117.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/recipes/checks/systemd/init.d-general')
-rw-r--r--t/recipes/checks/systemd/init.d-general/build-spec/debian/control.in61
-rw-r--r--t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-bugs.init17
-rw-r--r--t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-bugs.postinst10
-rw-r--r--t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-interpreter-in-usr-dir.init14
-rw-r--r--t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-new-style.init31
-rw-r--r--t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-sourcing-without-test.init52
-rw-r--r--t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general.default17
-rw-r--r--t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general.init21
-rw-r--r--t/recipes/checks/systemd/init.d-general/build-spec/fill-values3
-rw-r--r--t/recipes/checks/systemd/init.d-general/eval/desc2
-rw-r--r--t/recipes/checks/systemd/init.d-general/eval/hints6
11 files changed, 234 insertions, 0 deletions
diff --git a/t/recipes/checks/systemd/init.d-general/build-spec/debian/control.in b/t/recipes/checks/systemd/init.d-general/build-spec/debian/control.in
new file mode 100644
index 0000000..80dcc37
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/build-spec/debian/control.in
@@ -0,0 +1,61 @@
+Source: [% $source %]
+Priority: optional
+Section: [% $section %]
+Maintainer: [% $author %]
+Standards-Version: [% $standards_version %]
+Build-Depends: [% $build_depends %]
+Rules-Requires-Root: no
+
+Package: [% $source %]
+Architecture: [% $package_architecture %]
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.0-6)
+Description: [% $description %]
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+
+Package: [% $source %]-bugs
+Architecture: [% $package_architecture %]
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.0-6)
+Description: [% $description %] -- bugs
+ Test some simple bugs in the check
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+
+Package: [% $source %]-interpreter-in-usr-dir
+Architecture: [% $package_architecture %]
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] -- bad script interpreter
+ Test a check for a /usr dir interpreter used in an init script
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+
+Package: [% $source %]-sourcing-without-test
+Architecture: [% $package_architecture %]
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.0-6)
+Description: [% $description %] -- sourcing without test
+ Test a check for . /etc/default/foo without checking the existence of
+ the file beforehand.
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
+
+Package: [% $source %]-new-style
+Architecture: [% $package_architecture %]
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: [% $description %] -- "new style"
+ New style of init.d. (#919604)
+ .
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package.
diff --git a/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-bugs.init b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-bugs.init
new file mode 100644
index 0000000..55305ab
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-bugs.init
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+### BEGIN INIT INFO
+# Provides: init.d-general-bugs
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop:
+# Short-Description: Do nothing at all
+# Description: The short description pretty much covers it.
+### END INIT INFO
+
+# start stop force-reload restart status
+
+. /lib/lsb/init-functions
diff --git a/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-bugs.postinst b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-bugs.postinst
new file mode 100644
index 0000000..e3bb515
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-bugs.postinst
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if [ "$1" = "configure" ] ; then
+ # duplicate call as debhelper will add one for us
+ update-rc.d init.d-general-bugs word
+fi
diff --git a/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-interpreter-in-usr-dir.init b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-interpreter-in-usr-dir.init
new file mode 100644
index 0000000..ff7698c
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-interpreter-in-usr-dir.init
@@ -0,0 +1,14 @@
+#!/usr/bin/perl -w
+
+### BEGIN INIT INFO
+# Provides: init.d-general-interpreter-in-usr-dir
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start daemon at boot time
+# Description: Enable service provided by daemon.
+### END INIT INFO
+
+printf "start status stop reload restart force-reload\n";
+
diff --git a/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-new-style.init b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-new-style.init
new file mode 100644
index 0000000..e815337
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-new-style.init
@@ -0,0 +1,31 @@
+#!/usr/bin/env /lib/init/init-d-script
+### BEGIN INIT INFO
+# Provides: init.d-general-new-style
+# Should-Start: $syslog
+# Required-Start: $time $local_fs
+# Required-Stop: $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: init.d-general-new-style
+### END INIT INFO
+NAME='init.d-general-new-style'
+DESC='init.d-general-new-style description here'
+DAEMON=/usr/sbin/init.d-general-new-styl
+
+daemon_ () { /usr/bin/daemon --noconfig --name "${NAME}" "$@"; }
+if ! test -x '/usr/bin/daemon' ; then
+ log_failure_msg "install \`daemon' package to use ${NAME} script"
+ exit 1
+fi
+
+do_start_cmd_override () {
+ daemon_ "${DAEMON}"
+}
+
+do_stop_cmd_override () {
+ if daemon_ --running ; then
+ daemon_ --stop
+ fi
+}
+
+# vim: ft=sh
diff --git a/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-sourcing-without-test.init b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-sourcing-without-test.init
new file mode 100644
index 0000000..7046ed9
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general-sourcing-without-test.init
@@ -0,0 +1,52 @@
+#!/bin/sh -e
+
+### BEGIN INIT INFO
+# Provides: init.d-general-sourcing-without-test
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start daemon at boot time
+# Description: Enable service provided by daemon.
+### END INIT INFO
+
+echo start stop reload restart force-reload status
+
+. /lib/lsb/init-functions
+
+. /etc/default/rcS
+
+[ ! -f /etc/default/foo ] || . /etc/default/foo
+
+[ -f /etc/default/bar ] && . /etc/default/bar
+
+if [ -e /etc/default/locale ]; then
+ . /etc/default/locale
+fi
+
+if [ -f /etc/default/moo ]; then
+ . /etc/default/moo
+fi
+
+if [ -r /etc/default/tmpfs ]; then
+ . /etc/default/tmpfs
+fi
+
+PACKAGE=moo
+[ -f /etc/default/$PACKAGE ] && . /etc/default/$PACKAGE
+
+if [ -f /etc/default/$PACKAGE ]; then
+ . /etc/default/$PACKAGE
+fi
+
+if test -f /etc/default/$PACKAGE; then
+ . /etc/default/$PACKAGE
+fi
+
+# This is not sourcing without a test and shouldn't produce an error.
+if [ ! -f /etc/default/$PACKAGE ] ; then
+ # do something else
+ :
+else
+ . /etc/default/$PACKAGE
+fi
diff --git a/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general.default b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general.default
new file mode 100644
index 0000000..c1d7f21
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general.default
@@ -0,0 +1,17 @@
+ENABLED="false"
+ENABLED=false
+DISABLED="true"
+DISABLED=true
+RUN="true"
+RUN=true
+PREFIXRUN="true"
+PREFIXRUN=true
+
+# ENABLED="false"
+# ENABLED=false
+# DISABLED="true"
+# DISABLED=true
+# RUN="true"
+# RUN=true
+# PREFIXRUN="true"
+# PREFIXRUN=true
diff --git a/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general.init b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general.init
new file mode 100644
index 0000000..b3e8ae7
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/build-spec/debian/init.d-general.init
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+. /lib/lsb/init-functions
+
+### BEGIN INIT INFO
+# Provides: init.d-general
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop:
+# Short-Description: Do nothing at all
+# Description: The short description pretty much covers it.
+### END INIT INFO
+
+case "$1" in
+ start|stop|force-reload|restart|status|*)
+ echo hello world!
+ ;;
+esac
diff --git a/t/recipes/checks/systemd/init.d-general/build-spec/fill-values b/t/recipes/checks/systemd/init.d-general/build-spec/fill-values
new file mode 100644
index 0000000..e567c49
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/build-spec/fill-values
@@ -0,0 +1,3 @@
+Skeleton: upload-native
+Testname: init.d-general
+Description: Test tags related to the init.d checks
diff --git a/t/recipes/checks/systemd/init.d-general/eval/desc b/t/recipes/checks/systemd/init.d-general/eval/desc
new file mode 100644
index 0000000..9f2f714
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/eval/desc
@@ -0,0 +1,2 @@
+Testname: init.d-general
+Check: systemd
diff --git a/t/recipes/checks/systemd/init.d-general/eval/hints b/t/recipes/checks/systemd/init.d-general/eval/hints
new file mode 100644
index 0000000..e13be56
--- /dev/null
+++ b/t/recipes/checks/systemd/init.d-general/eval/hints
@@ -0,0 +1,6 @@
+init.d-general-sourcing-without-test (binary): missing-systemd-service-for-init.d-script init.d-general-sourcing-without-test [etc/init.d/init.d-general-sourcing-without-test]
+init.d-general-new-style (binary): missing-systemd-service-for-init.d-script init.d-general-new-style [etc/init.d/init.d-general-new-style]
+init.d-general-interpreter-in-usr-dir (binary): missing-systemd-service-for-init.d-script init.d-general-interpreter-in-usr-dir [etc/init.d/init.d-general-interpreter-in-usr-dir]
+init.d-general-interpreter-in-usr-dir (binary): init.d-script-does-not-source-init-functions [etc/init.d/init.d-general-interpreter-in-usr-dir]
+init.d-general-bugs (binary): missing-systemd-service-for-init.d-script init.d-general-bugs [etc/init.d/init.d-general-bugs]
+init.d-general (binary): missing-systemd-service-for-init.d-script init.d-general [etc/init.d/init.d-general]