summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/include.rc')
-rw-r--r--tests/include.rc25
1 files changed, 22 insertions, 3 deletions
diff --git a/tests/include.rc b/tests/include.rc
index 5315fa857a7..8b06363894e 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -6,6 +6,7 @@ N1=${N1:=/mnt/nfs/1}; # 1st mount point for NFS
V0=${V0:=patchy}; # volume name to use in tests
V1=${V1:=patchy1}; # volume name to use in tests
B0=${B0:=/d/backends}; # top level of brick directories
+WORKDIRS="$B0 $M0 $M1 $M2 $N0 $N1"
CC=cc
OSTYPE=$(uname -s)
@@ -63,9 +64,7 @@ statedumpdir=`gluster --print-statedumpdir`; # Default directory for statedump
CLI="gluster --mode=script --wignore";
GFS="glusterfs --attribute-timeout=0 --entry-timeout=0";
-mkdir -p $B0;
-mkdir -p $M0 $M1 $M2;
-mkdir -p $N0 $N1;
+mkdir -p $WORKDIRS
case $OSTYPE in
FreeBSD | Darwin)
@@ -441,6 +440,26 @@ function cleanup()
umount $flag $N0 2>/dev/null || umount -f $N0 2>/dev/null || true;
umount $flag $N1 2>/dev/null || umount -f $N1 2>/dev/null || true;
+ rm -rf $WORKDIRS
+ leftover=""
+ for d in $WORKDIRS ; do
+ if test -d $d ; then
+ leftover="$leftover $d"
+ fi
+ done
+ if [ "x$leftover" != "x" ] ; then
+ echo "Aborting."
+ echo
+ echo "$d could not be deleted, here are the left over items"
+ for d in $leftover; do
+ find $d -exec ls -ld {} \;
+ done
+ echo
+ echo "Please correct the problem and try again."
+ echo
+ exit 1
+ fi >&2
+ mkdir -p $WORKDIRS
}
function volinfo_field()