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

pere at users.alioth.debian.org pere at users.alioth.debian.org
Sun Jan 13 17:26:19 UTC 2008


Author: pere
Date: Sun Jan 13 17:26:19 2008
New Revision: 520

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=520
Log:
Make removal test not fatal for now.

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

Modified: trunk/src/insserv/debian/run-testsuite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=520&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Sun Jan 13 17:26:19 2008
@@ -638,7 +638,8 @@
 check_script_not_present S onlystop
 
 echo
-echo "info: test if script removal removes all symlinks"
+echo "info: test if script removal removes all symlinks."
+echo "warning: This test should be fatal, but is non-fatal until a fix is found."
 echo
 # This test check that the common way to update the runlevels used by
 # a given script is working.  It simulates these calls to update-rc.d:
@@ -684,10 +685,10 @@
 
 list_rclinks
 
-check_script_not_present 0 oldscript
-check_script_present 1 oldscript
-check_script_present 2 oldscript
-check_script_not_present 3 oldscript
-check_script_not_present 6 oldscript
+test_script_not_present 0 oldscript
+test_script_present 1 oldscript
+test_script_present 2 oldscript
+test_script_not_present 3 oldscript
+test_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=520&op=diff
==============================================================================
--- trunk/src/insserv/debian/testsuite-common (original)
+++ trunk/src/insserv/debian/testsuite-common Sun Jan 13 17:26:19 2008
@@ -19,6 +19,15 @@
 # The specific test suites need to define runlevel_path(),
 # list_rclinks() and insserv_reg().
 
+error() {
+    echo error: $@
+    retval=1
+}
+
+warning() {
+    echo warning: $@
+}
+
 addscript() {
     scriptname=$1
     script=$initddir/$scriptname
@@ -32,23 +41,51 @@
     insserv_reg $scriptname
 }
 
-check_script_present() {
+present_ok() {
     runlevel=$1
     script=$2
     present="$(echo $(cd $(runlevel_path $runlevel); ls *$script 2>/dev/null) )"
     if [ "$present" ] ; then
 	return 0
     fi
+    return 1
+}
+
+check_script_present() {
+    runlevel=$1
+    script=$2
+    if present_ok $runlevel $script ; then
+	return 0
+    fi
     error "script $script not present in runlevel $runlevel"
+    return 0
+}
+
+test_script_present() {
+    runlevel=$1
+    script=$2
+    if present_ok $runlevel $script ; then
+	return 0
+    fi
+    warning "script $script not present in runlevel $runlevel"
     return 0
 }
 
 check_script_not_present() {
     runlevel=$1
     script=$2
-    present="$(echo $(cd $(runlevel_path $runlevel); ls *$script 2>/dev/null) )"
-    if [ "$present" ] ; then
+    if present_ok $runlevel $script ; then
 	error "script $script present in runlevel $runlevel"
+	return 0
+    fi
+    return 0;
+}
+
+test_script_not_present() {
+    runlevel=$1
+    script=$2
+    if present_ok $runlevel $script ; then
+	warning "script $script present in runlevel $runlevel"
 	return 0
     fi
     return 0;
@@ -63,15 +100,6 @@
 	return 0
     fi
     return 1;
-}
-
-error() {
-    echo error: $@
-    retval=1
-}
-
-warning() {
-    echo warning: $@
 }
 
 # Fatal check




More information about the Initscripts-ng-commits mailing list