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>
This commit is contained in:
Emmanuel Dreyfus 2014-11-10 09:34:39 +01:00 committed by Pranith Kumar Karampuri
parent 5f0f2282d6
commit 7c3609efb4

View File

@ -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()