Module Name:    src
Committed By:   jmmv
Date:           Thu Mar 24 21:52:51 UTC 2011

Modified Files:
        src/tests/fs/tmpfs: t_vnd.sh
        src/tests/modules: t_modload.sh

Log Message:
Prevent failures from cleanup routines.  Do so by only attempting to do the
cleanup if the test case did not succeed (as, when it succeeds, the cleanup
has already happened).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/tmpfs/t_vnd.sh
cvs rdiff -u -r1.8 -r1.9 src/tests/modules/t_modload.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/tmpfs/t_vnd.sh
diff -u src/tests/fs/tmpfs/t_vnd.sh:1.6 src/tests/fs/tmpfs/t_vnd.sh:1.7
--- src/tests/fs/tmpfs/t_vnd.sh:1.6	Sun Nov  7 17:51:18 2010
+++ src/tests/fs/tmpfs/t_vnd.sh	Thu Mar 24 21:52:51 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_vnd.sh,v 1.6 2010/11/07 17:51:18 jmmv Exp $
+# $NetBSD: t_vnd.sh,v 1.7 2011/03/24 21:52:51 jmmv Exp $
 #
 # Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -61,10 +61,13 @@
 	atf_check -s eq:0 -o empty -e empty vnconfig -u /dev/vnd3
 
 	test_unmount
+	touch done
 }
 basic_cleanup() {
-	umount mnt 2>/dev/null 1>&2
-	vnconfig -u /dev/vnd3 2>/dev/null 1>&2
+	if [ ! -f done ]; then
+		umount mnt 2>/dev/null 1>&2
+		vnconfig -u /dev/vnd3 2>/dev/null 1>&2
+	fi
 }
 
 atf_init_test_cases() {

Index: src/tests/modules/t_modload.sh
diff -u src/tests/modules/t_modload.sh:1.8 src/tests/modules/t_modload.sh:1.9
--- src/tests/modules/t_modload.sh:1.8	Sun Nov  7 17:51:20 2010
+++ src/tests/modules/t_modload.sh	Thu Mar 24 21:52:51 2011
@@ -1,4 +1,4 @@
-# $NetBSD: t_modload.sh,v 1.8 2010/11/07 17:51:20 jmmv Exp $
+# $NetBSD: t_modload.sh,v 1.9 2011/03/24 21:52:51 jmmv Exp $
 #
 # Copyright (c) 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,9 +47,10 @@
 	check_sysctl vendor.k_helper.prop_int_ok 0
 	check_sysctl vendor.k_helper.prop_str_ok 0
 	atf_check -s eq:0 -o empty -e empty modunload k_helper
+	touch done
 }
 plain_cleanup() {
-	modunload k_helper >/dev/null 2>&1
+	test -f done || modunload k_helper >/dev/null 2>&1
 }
 
 atf_test_case bflag cleanup
@@ -89,7 +90,7 @@
 	#echo "Checking valid values"
 }
 bflag_cleanup() {
-	modunload k_helper >/dev/null 2>&1
+	modunload k_helper >/dev/null 2>&1 || true
 }
 
 atf_test_case iflag cleanup
@@ -130,9 +131,10 @@
 		check_sysctl vendor.k_helper.prop_int_val "${v}"
 		atf_check -s eq:0 -o empty -e empty modunload k_helper
 	done
+	touch done
 }
 iflag_cleanup() {
-	modunload k_helper >/dev/null 2>&1
+	test -f done || modunload k_helper >/dev/null 2>&1
 }
 
 atf_test_case sflag cleanup
@@ -158,9 +160,10 @@
 		check_sysctl vendor.k_helper.prop_str_val "${v}"
 		atf_check -s eq:0 -o empty -e empty modunload k_helper
 	done
+	touch done
 }
 sflag_cleanup() {
-	modunload k_helper >/dev/null 2>&1
+	test -f done || modunload k_helper >/dev/null 2>&1
 }
 
 atf_init_test_cases()

Reply via email to