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

pere at users.alioth.debian.org pere at users.alioth.debian.org
Mon Jan 7 21:45:38 UTC 2008


Author: pere
Date: Mon Jan  7 21:45:38 2008
New Revision: 471

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=471
Log:
  * Restructure test script to work with new test feature implemented
    in version 1.10.

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=471&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Mon Jan  7 21:45:38 2008
@@ -14,6 +14,8 @@
   * Added override file for hpoj.
   * Ask if insserv should be activated at install time, using a medium
     priority debconf question.
+  * Restructure test script to work with new test feature implemented
+    in version 1.10.
 
  -- Petter Reinholdtsen <pere at debian.org>  Sun,  6 Jan 2008 11:07:24 +0100
 

Modified: trunk/src/insserv/debian/run-testsuite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=471&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Mon Jan  7 21:45:38 2008
@@ -3,11 +3,12 @@
 set -e
 
 tmpdir=`pwd`/testdir
-initddir=$tmpdir/init.d
+initddir=$tmpdir/etc/init.d
 
 insserv=`pwd`/insserv
-insconf=$tmpdir/insserv.conf
-overridedir=$tmpdir/insserv/override
+# Relative to $tmpdir
+insconf=/etc/insserv.conf
+overridedir=$tmpdir/etc/insserv/override
 
 retval=0
 
@@ -36,18 +37,28 @@
 check_script_present() {
     runlevel=$1
     script=$2
-    present="$(echo $(cd $tmpdir/rc$runlevel.d/; ls *$script) )"
+    present="$(echo $(cd $initddir/../rc$runlevel.d/; ls *$script 2>/dev/null) )"
     if [ "$present" ] ; then
 	return 0
     fi
     return 1;
 }
 
+check_script_not_present() {
+    runlevel=$1
+    script=$2
+    present="$(echo $(cd $initddir/../rc$runlevel.d/; ls *$script 2>/dev/null) )"
+    if [ "$present" ] ; then
+	return 1
+    fi
+    return 0;
+}
+
 order_ok() {
     runlevel=$1
     script1=$2
     script2=$3
-    order="$(echo $(cd $tmpdir/rc$runlevel.d/; ls *$script1 *$script2 2>/dev/null | sed 's/[SK]..//') )"
+    order="$(echo $(cd $initddir/../rc$runlevel.d/; ls *$script1 *$script2 2>/dev/null | sed 's/[SK]..//') )"
     if [ "$order" != "$script1 $script2" ] ; then
 	return 0
     fi
@@ -86,7 +97,7 @@
 echo "info: test normal boot sequence scripts, and their order"
 echo
 
-cat <<'EOF' > $insconf
+cat <<'EOF' > $tmpdir$insconf
 $local_fs       +mountall +umountfs
 $network        +networking +ifupdown
 $named          +named +dnsmasq +lwresd +bind9 $network
@@ -355,7 +366,7 @@
 insertscript nolsbheader <<'EOF'
 EOF
 
-(cd $tmpdir && ls *)
+(cd $initddir/../. && ls *)
 
 check_order S mountkernfs.sh mountdevsubfs.sh
 check_order S ifupdown-clean ifupdown
@@ -426,13 +437,13 @@
 
 insserv_reg mover
 
-(cd $tmpdir && ls *)
+(cd $initddir/../. && ls *)
 
 # Make sure the override file moved mover before base
 check_order S mover base
 
 echo
-echo "info: testing to insert scripts with a loop"
+echo "info: testing to insert scripts with a loop, and the effect of an override file"
 echo
 rm -rf $initddir
 mkdir -p $initddir
@@ -471,6 +482,9 @@
 # Default-Stop:
 ### END INIT INFO
 EOF
+
+check_script_not_present S loop1
+check_script_not_present S loop2
 
 insserv_reg loop1 || true
 insserv_reg loop2 || true
@@ -552,7 +566,7 @@
 ### END INIT INFO
 EOF
 
-(cd $tmpdir && ls *)
+(cd $initddir/../. && ls *)
 
 test_order S startfirst startsecond
 test_order 6 startsecond startfirst
@@ -588,7 +602,7 @@
 ### END INIT INFO
 EOF
 
-(cd $tmpdir && ls *)
+(cd $initddir/../. && ls *)
 
 # Test another fake loop using reverse dependencies to document that
 # it can happen based on information provided in one package only.
@@ -625,7 +639,7 @@
 ### END INIT INFO
 EOF
 
-(cd $tmpdir && ls *)
+(cd $initddir/../. && ls *)
 
 # These are checking real bugs, but until bug #458582 is fixed, they
 # will fail.  Making the tests non-fatal because of this.
@@ -659,7 +673,7 @@
 ### END INIT INFO
 EOF
 
-(cd $tmpdir && ls *)
+(cd $initddir/../. && ls *)
 
 check_script_present S distroglobal
 




More information about the Initscripts-ng-commits mailing list