summaryrefslogtreecommitdiff
path: root/usr.sbin/unbound/testcode/mini_tdir.sh
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/unbound/testcode/mini_tdir.sh')
-rwxr-xr-xusr.sbin/unbound/testcode/mini_tdir.sh23
1 files changed, 17 insertions, 6 deletions
diff --git a/usr.sbin/unbound/testcode/mini_tdir.sh b/usr.sbin/unbound/testcode/mini_tdir.sh
index 0457a95e709..6bbece8d936 100755
--- a/usr.sbin/unbound/testcode/mini_tdir.sh
+++ b/usr.sbin/unbound/testcode/mini_tdir.sh
@@ -5,6 +5,10 @@ if test "$1" = "-a"; then
shift
shift
fi
+
+# This will keep the temporary directory around and return 1 when the test failed.
+DEBUG=0
+
quiet=0
if test "$1" = "-q"; then
quiet=1
@@ -184,11 +188,18 @@ echo "DateRunEnd: "`date "+%s" 2>/dev/null` >> $result
mv $result ..
cd ..
-rm -rf $dir
-# compat for windows where deletion may not succeed initially (files locked
-# by processes that still have to exit).
-if test $? -eq 1; then
- echo "minitdir waiting for processes to terminate"
- sleep 2 # some time to exit, and try again
+if test $DEBUG -eq 0; then
rm -rf $dir
+ # compat for windows where deletion may not succeed initially (files locked
+ # by processes that still have to exit).
+ if test $? -eq 1; then
+ echo "minitdir waiting for processes to terminate"
+ sleep 2 # some time to exit, and try again
+ rm -rf $dir
+ fi
+else
+ if test $success == "no"; then
+ exit 1
+ fi
+ exit 0
fi