Skip to content
Snippets Groups Projects
Commit 1a4808d0 authored by Elena Gryaznova's avatar Elena Gryaznova
Browse files

b=14394

i=Adilger

fix MOUNT clobber
parent 98946b3e
No related branches found
No related tags found
No related merge requests found
...@@ -25,8 +25,16 @@ LUSTRE=${LUSTRE:-`dirname $0`/..} ...@@ -25,8 +25,16 @@ LUSTRE=${LUSTRE:-`dirname $0`/..}
init_test_env $@ init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh} . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
WAS_MOUNTED=`mount | grep $MOUNT || true` # if nothing mounted, don't nuke MOUNT variable needed in llmount.sh
[ -z "$WAS_MOUNTED" ] && sh llmount.sh WAS_MOUNTED=$(mounted_lustre_filesystems | head -1)
if [ -z "$WAS_MOUNTED" ]; then
# This code doesn't handle multiple mounts well, so nuke MOUNT2 variable
MOUNT2="" sh llmount.sh
MOUNT=$(mounted_lustre_filesystems)
[ -z "$MOUNT" ] && echo "NAME=$NAME not mounted" && exit 2
else
MOUNT=${WAS_MOUNTED}
fi
DIR=$DIR/$TESTNAME DIR=$DIR/$TESTNAME
[ -z "`echo $DIR | grep $MOUNT`" ] && echo "$DIR not in $MOUNT" && exit 3 [ -z "`echo $DIR | grep $MOUNT`" ] && echo "$DIR not in $MOUNT" && exit 3
...@@ -48,7 +56,8 @@ get_mnt_devs() { ...@@ -48,7 +56,8 @@ get_mnt_devs() {
if [ "$LFSCK_SETUP" != "no" ]; then if [ "$LFSCK_SETUP" != "no" ]; then
#Create test directory #Create test directory
rm -rf $DIR # -- can't remove the mountpoint...
[ -z "$DIR" ] && rm -rf $DIR/*
mkdir -p $DIR mkdir -p $DIR
OSTCOUNT=`$GETSTRIPE $MOUNT | grep -c "^[0-9]*: " || true` OSTCOUNT=`$GETSTRIPE $MOUNT | grep -c "^[0-9]*: " || true`
...@@ -186,7 +195,7 @@ done ...@@ -186,7 +195,7 @@ done
# lfsck will return 1 if the filesystem had errors fixed # lfsck will return 1 if the filesystem had errors fixed
echo "LFSCK TEST 1" echo "LFSCK TEST 1"
echo "lfsck -c -l --mdsdb $MDSDB --ostdb $OSTDB_LIST $MOUNT" echo "lfsck -c -l --mdsdb $MDSDB --ostdb $OSTDB_LIST $MOUNT"
lfsck -c -l --mdsdb $MDSDB --ostdb $OSTDB_LIST $MOUNT echo y | lfsck -c -l --mdsdb $MDSDB --ostdb $OSTDB_LIST $MOUNT
RET=$? RET=$?
[ $RET -eq 0 ] && echo "clean after first check" && exit 0 [ $RET -eq 0 ] && echo "clean after first check" && exit 0
echo "LFSCK TEST 1 - finished with rc=$RET" echo "LFSCK TEST 1 - finished with rc=$RET"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment