[Initscripts-ng-commits] r461 - /trunk/src/insserv/debian/run-testsuite

pere at users.alioth.debian.org pere at users.alioth.debian.org
Mon Jan 7 09:51:06 UTC 2008


Author: pere
Date: Mon Jan  7 09:51:06 2008
New Revision: 461

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=461
Log:
New test.

Modified:
    trunk/src/insserv/debian/run-testsuite

Modified: trunk/src/insserv/debian/run-testsuite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=461&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Mon Jan  7 09:51:06 2008
@@ -20,12 +20,27 @@
     $insserv $debug -c $insconf -p $initddir -o $overridedir $script
 }
 
-insertscript() {
+addscript() {
     scriptname=$1
     script=$initddir/$scriptname
     cat > $script
     chmod a+rx $script
+}
+
+insertscript() {
+    scriptname=$1
+    addscript $scriptname
     insserv_reg $scriptname
+}
+
+check_script_present() {
+    runlevel=$1
+    script=$2
+    present="$(echo $(cd $tmpdir/rc$runlevel.d/; ls *$script) )"
+    if [ "$present" ] ; then
+	return 0
+    fi
+    return 1;
 }
 
 order_ok() {
@@ -617,6 +632,37 @@
 test_order S startfirst_stopfirst startsecond_stoplast
 test_order 6 startfirst_stopfirst startsecond_stoplast 
 
+echo
+echo "info: test if bad script in init.d/ with no symlinks in rc*.d/ make problems"
+echo
+
+rm -rf $initddir
+mkdir -p $initddir
+
+addscript sitelocal <<'EOF' || true
+### BEGIN INIT INFO
+# Provides:          duplicate
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Default-Start:     S
+# Default-Stop:      6
+### END INIT INFO
+EOF
+
+insertscript distroglobal <<'EOF' || true
+### BEGIN INIT INFO
+# Provides:          dublicate_stoplast
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Default-Start:     S
+# Default-Stop:      6
+### END INIT INFO
+EOF
+
+(cd $tmpdir && ls *)
+
+check_script_present S distroglobal
+
 if [ 0 != $retval ] ; then
     echo "error: one or more test failed."
 else




More information about the Initscripts-ng-commits mailing list