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

pere at users.alioth.debian.org pere at users.alioth.debian.org
Tue Jan 1 21:24:51 UTC 2008


Author: pere
Date: Tue Jan  1 21:24:50 2008
New Revision: 403

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=403
Log:
  * Implement support for non-fatal tests in the testsuite.

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

Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=403&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Tue Jan  1 21:24:50 2008
@@ -3,6 +3,7 @@
   * UNRELEASED
 
   * Add test to demonstrate the fake loop warning issue.
+  * Implement support for non-fatal tests in the testsuite.
 
  -- Petter Reinholdtsen <pere at debian.org>  Tue,  1 Jan 2008 21:57:58 +0100
 

Modified: trunk/src/insserv/debian/run-testsuite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=403&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Tue Jan  1 21:24:50 2008
@@ -28,14 +28,29 @@
     insserv_reg $scriptname
 }
 
-check_order() {
+order_ok() {
     runlevel=$1
     script1=$2
     script2=$3
     order="$(echo $(cd $tmpdir/rc$runlevel.d/; ls *$script1 *$script2 2>/dev/null | sed 's/[SK]..//') )"
     if [ "$order" != "$script1 $script2" ] ; then
+	return 0
+    fi
+    return 1;
+}
+
+# Fatal check
+check_order() {
+    if order_ok $@ ; then
 	echo "error: incorrect $runlevel sequence $script1 not before $script2"
 	retval=1
+    fi
+}
+
+# Non-fatal check
+test_order() {
+    if order_ok $@ ; then
+	echo "warning: incorrect $runlevel sequence $script1 not before $script2"
     fi
 }
 
@@ -360,7 +375,7 @@
 insserv_reg loop2 || true
 
 # XXX This do not work yet, as the override file seem to be ignored
-#check_order S loop1 loop2
+test_order S loop1 loop2
 
 # Test fake loop.  The loop is in the combined start and stop
 # sequence.  There is no loop in the start sequence, and no loop in
@@ -394,8 +409,8 @@
 
 (cd $tmpdir && ls *)
 
-check_order S startfirst startsecond
-check_order 6 startsecond startfirst
+test_order S startfirst startsecond
+test_order 6 startsecond startfirst
 
 # Test another fake loop.  This one should work, as it is possible to
 # install the two scripts in sequence because one of the dependencies




More information about the Initscripts-ng-commits mailing list