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

pere at users.alioth.debian.org pere at users.alioth.debian.org
Fri Feb 8 11:29:33 UTC 2008


Author: pere
Date: Fri Feb  8 11:29:33 2008
New Revision: 595

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=595
Log:
Restructure test suite to make it easier to enable and disable single tests.

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=595&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Fri Feb  8 11:29:33 2008
@@ -24,10 +24,7 @@
     $insserv $debug -c $insconf -p $initddir -o $overridedir $@ $script
 }
 
-echo
-echo "info: test normal boot sequence scripts, and their order"
-echo
-
+update_conf() {
 set +C
 cat <<'EOF' > $insconf
 $local_fs       +mountall +umountfs
@@ -40,6 +37,11 @@
 <interactive>   udev mountdevsubfs checkroot checkfs console-screen
 EOF
 set -C
+}
+test_normal_sequence() {
+echo
+echo "info: test normal boot sequence scripts, and their order"
+echo
 
 insertscript mountkernfs.sh <<EOF
 ### BEGIN INIT INFO
@@ -317,7 +319,9 @@
 check_order 6 umountroot reboot
 check_order 6 umountroot kexec
 check_order 6 kexec reboot
-
+}
+
+test_override_files() {
 echo
 echo "info: test if override files replace headers in the file"
 echo
@@ -365,7 +369,9 @@
 
 # Make sure the override file moved mover before base
 check_order S mover base
-
+}
+
+test_override_loop() {
 echo
 echo "info: testing to insert scripts with a loop, and the effect of an override file"
 echo
@@ -414,7 +420,10 @@
 insserv_reg loop2 || true
 
 check_order S loop1 loop2
-
+}
+
+
+test_long_loop() {
 echo
 echo "info: testing to insert scripts with a longer loop, making sure it fail"
 echo
@@ -456,7 +465,9 @@
 EOF
     error "inserting script causing a loop did not fail"
 fi
-
+}
+
+test_combined_loop() {
 # Test real loop in the combined start and stop sequence.  There is no
 # loop in the start sequence, and no loop in the stop sequence, but in
 # the combined graph insserv is creating internally, there is a loop.
@@ -494,7 +505,9 @@
 
 test_order S startfirst startsecond
 test_order 6 startsecond startfirst
-
+}
+
+test_fake_loop() {
 # Test another fake loop.  This one should work, as it is possible to
 # install the two scripts in sequence because one of the dependencies
 # are optional.  It does not with insserv today.
@@ -527,7 +540,9 @@
 EOF
 
 list_rclinks
-
+}
+
+test_fake_loop_reverse() {
 # Test another fake loop using reverse dependencies to document that
 # it can happen based on information provided in one package only.
 # This should work, as it is possible to install the two scripts in
@@ -570,7 +585,9 @@
 # will fail.  Making the tests non-fatal because of this.
 ${severity}_order S startfirst_stopfirst startsecond_stoplast
 ${severity}_order 6 startfirst_stopfirst startsecond_stoplast 
-
+}
+
+test_badscript() {
 echo
 echo "info: test if bad script in init.d/ with no symlinks in rc*.d/ make problems"
 echo
@@ -601,7 +618,9 @@
 list_rclinks
 
 check_script_present S distroglobal
-
+}
+
+test_onlystop() {
 echo
 echo "info: check that it work to insert scripts with only stop runlevels"
 echo
@@ -615,7 +634,6 @@
 mkdir -p $initddir
 
 insertscript onlystop <<'EOF' || true
-addscript onlystop <<'EOF' || true
 ### BEGIN INIT INFO
 # Provides:          onlystop
 # Required-Start:    $remote_fs
@@ -636,7 +654,9 @@
 check_script_not_present 4 onlystop
 check_script_not_present 5 onlystop
 check_script_not_present S onlystop
-
+}
+
+test_removal() {
 echo
 echo "info: test if script removal removes all symlinks."
 echo
@@ -650,7 +670,6 @@
 mkdir -p $initddir
 
 insertscript oldscript <<'EOF' || true
-addscript oldscript <<'EOF' || true
 ### BEGIN INIT INFO
 # Provides:          oldscript
 # Required-Start:    $remote_fs
@@ -667,6 +686,7 @@
 check_script_present 3 oldscript
 check_script_present 6 oldscript
 
+set +C
 addscript oldscript <<'EOF' || true
 ### BEGIN INIT INFO
 # Provides:          oldscript
@@ -676,6 +696,7 @@
 # Default-Stop:      1
 ### END INIT INFO
 EOF
+set -C
 
 # Remove old symlinks
 insserv_reg oldscript -r
@@ -689,8 +710,10 @@
 check_script_present 2 oldscript
 check_script_not_present 3 oldscript
 check_script_not_present 6 oldscript
+}
 
 ##########################################################################
+test_segfault_virtfac() {
 echo
 echo "info: detect segfault caused by script providing virtual facility."
 echo
@@ -727,6 +750,9 @@
 list_rclinks
 
 check_script_present 2 okscript
+}
+
+test_incorrect_stopscripts() {
 ##########################################################################
 echo
 echo "info: Check if insserv add stop symlinks for scripts that"
@@ -768,7 +794,21 @@
 ${severity}_script_not_present 0 script
 ${severity}_script_not_present 1 script
 check_script_not_present 1 nostopscript
-
+}
 ##########################################################################
 
+update_conf
+test_normal_sequence
+test_override_files
+test_override_loop
+test_long_loop
+test_combined_loop
+test_fake_loop
+test_fake_loop_reverse
+test_badscript
+test_onlystop
+test_removal
+test_segfault_virtfac
+test_incorrect_stopscripts
+
 finish_test




More information about the Initscripts-ng-commits mailing list