[Initscripts-ng-commits] r488 - in /trunk/src/insserv/debian: changelog run-testsuite testsuite-common

pere at users.alioth.debian.org pere at users.alioth.debian.org
Thu Jan 10 09:13:19 UTC 2008


Author: pere
Date: Thu Jan 10 09:13:19 2008
New Revision: 488

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=488
Log:
  * Add test case for problem with symlink removal, bug #460034.

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=488&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Thu Jan 10 09:13:19 2008
@@ -1,3 +1,9 @@
+insserv (1.10.0-2) unstable; urgency=low
+
+  * Add test case for problem with symlink removal, bug #460034.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Wed,  9 Jan 2008 22:42:31 +0100
+
 insserv (1.10.0-2) unstable; urgency=low
 
   * Implement new check-initd-order option -c to be used with -g to

Modified: trunk/src/insserv/debian/run-testsuite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=488&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Thu Jan 10 09:13:19 2008
@@ -14,7 +14,8 @@
 
 insserv_reg() {
     script=$initddir/$1
-    $insserv $debug -c $insconf -p $initddir -o $overridedir $script
+    shift
+    $insserv $debug -c $insconf -p $initddir -o $overridedir $@ $script
 }
 
 echo
@@ -318,8 +319,6 @@
 check_order 6 umountroot kexec
 check_order 6 kexec reboot
 
-exit 0
-
 echo
 echo "info: test if override files replace headers in the file"
 echo
@@ -603,4 +602,43 @@
 
 check_script_present S distroglobal
 
+echo
+echo "info: test if script removal removes all symlinks"
+echo
+
+rm -rf $initddir
+mkdir -p $initddir
+
+insertscript oldscript <<'EOF' || true
+addscript oldscript <<'EOF' || true
+### BEGIN INIT INFO
+# Provides:          oldscript
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+### END INIT INFO
+EOF
+
+addscript oldscript <<'EOF' || true
+### BEGIN INIT INFO
+# Provides:          oldscript
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      1
+### END INIT INFO
+EOF
+
+# Remove old symlinks
+insserv_reg oldscript -r
+# Insert new ones, this time without runlevel 0 and 6
+insserv_reg oldscript
+
+list_rclinks
+
+check_script_not_present 0 oldscript
+check_script_present 1 oldscript
+check_script_not_present 6 oldscript
+
 finish_test

Modified: trunk/src/insserv/debian/testsuite-common
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/testsuite-common?rev=488&op=diff
==============================================================================
--- trunk/src/insserv/debian/testsuite-common (original)
+++ trunk/src/insserv/debian/testsuite-common Thu Jan 10 09:13:19 2008
@@ -39,7 +39,8 @@
     if [ "$present" ] ; then
 	return 0
     fi
-    return 1;
+    error "script $script not present in runlevel $runlevel"
+    return 0
 }
 
 check_script_not_present() {
@@ -47,7 +48,8 @@
     script=$2
     present="$(echo $(cd $(runlevel_path $runlevel); ls *$script 2>/dev/null) )"
     if [ "$present" ] ; then
-	return 1
+	error "script $script present in runlevel $runlevel"
+	return 0
     fi
     return 0;
 }




More information about the Initscripts-ng-commits mailing list