summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-11-10 09:34:39 +0100
committerPranith Kumar Karampuri <pkarampu@redhat.com>2014-11-10 08:17:24 -0800
commit7c3609efb458ec270b53b852b2bb877900d9e68d (patch)
treee8e7bcb3edb2d7535f3d97d8c46679d6c0722731 /tests/include.rc
parent5f0f2282d6e00a1de209a04c8270ee6cd8150d8b (diff)
Spurious failures fix for bug-948729.t and bug-948729-mode-script.t
Change I816b36e1d3e6933f92acf19d9be8eeaaa333356e causes sprurious failures in bug-948729.t and bug-948729-mode-script.t This seems to be caused by leftover information in /d/backends/ probably in a dot-prefixed directory. Attempt to fix this by removing /d/backends and other work directories on cleanup. While there we test and report failure to remove anything. BUG: 1129939 Change-Id: I0373c7f3c507db8ab509e8fd3aca2a386bea807e Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9081 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
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()