[Initscripts-ng-commits] r580 - in /trunk/src/insserv/debian: changelog run-testsuite testsuite-common
pere at users.alioth.debian.org
pere at users.alioth.debian.org
Mon Feb 4 18:18:35 UTC 2008
Author: pere
Date: Mon Feb 4 18:18:35 2008
New Revision: 580
URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=580
Log:
* Fix testsuite test that would incorrectly detect script names
matching a substring of other scripts names.
* New testsuite check to detect incorrectly inserted stop symlinks
when scripts with incorrect headers are encountered.
Modified:
trunk/src/insserv/debian/changelog
trunk/src/insserv/debian/run-testsuite
trunk/src/insserv/debian/testsuite-common
Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=580&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Mon Feb 4 18:18:35 2008
@@ -5,6 +5,10 @@
* Added script debian/seq-changes from Frans Pop installed in
/usr/share/insserv/ to extract the sequence changes done by
insserv.
+ * Fix testsuite test that would incorrectly detect script names
+ matching a substring of other scripts names.
+ * New testsuite check to detect incorrectly inserted stop symlinks
+ when scripts with incorrect headers are encountered.
-- Petter Reinholdtsen <pere at debian.org> Fri, 1 Feb 2008 19:45:46 +0100
Modified: trunk/src/insserv/debian/run-testsuite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=580&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Mon Feb 4 18:18:35 2008
@@ -700,6 +700,7 @@
check_script_not_present 3 oldscript
check_script_not_present 6 oldscript
+##########################################################################
echo
echo "info: detect segfault caused by script providing virtual facility."
echo
@@ -736,5 +737,48 @@
list_rclinks
check_script_present 2 okscript
+##########################################################################
+echo
+echo "info: Check if insserv add stop symlinks for scripts that"
+echo "info: currently do not have them."
+echo
+
+rm -rf $initddir/../rc*.d/*
+rm -rf $initddir/*
+mkdir -p $initddir
+
+addscript script <<'EOF' || true
+### BEGIN INIT INFO
+# Provides: script
+# Required-Start:
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+### END INIT INFO
+EOF
+
+# Problem is only triggered if there are start or stop symlinks for
+# the script present.
+for runlevel in 2 3 4 5 ; do
+ mkdir -p $initddir/../rc$runlevel.d
+ ln -s ../init.d/script $initddir/../rc$runlevel.d/S02script
+done
+
+check_script_present 2 script
+check_script_present 5 script
+check_script_not_present 1 script
+check_script_not_present S script
+
+# Update symlinks, see if it add stop symlinks
+insserv_reg .
+
+list_rclinks
+
+check_script_present 2 script
+check_script_present 5 script
+check_script_not_present 1 script
+check_script_not_present S script
+
+##########################################################################
finish_test
Modified: trunk/src/insserv/debian/testsuite-common
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/testsuite-common?rev=580&op=diff
==============================================================================
--- trunk/src/insserv/debian/testsuite-common (original)
+++ trunk/src/insserv/debian/testsuite-common Mon Feb 4 18:18:35 2008
@@ -44,7 +44,7 @@
present_ok() {
runlevel=$1
script=$2
- present="$(echo $(cd $(runlevel_path $runlevel); ls *$script 2>/dev/null) )"
+ present="$(echo $(cd $(runlevel_path $runlevel); ls ???$script 2>/dev/null) )"
if [ "$present" ] ; then
return 0
fi
More information about the Initscripts-ng-commits
mailing list