Whamcloud - gitweb
LU-992 build: remove obsolete rhel5 server configurations
[fs/lustre-release.git] / lustre / tests / lfsck.sh
index 8d2ad27..9e08e0b 100644 (file)
@@ -28,11 +28,6 @@ which can be accessable on all of the nodes" && exit 0; }
 which getfattr &>/dev/null || { skip_env "could not find getfattr" && exit 0; }
 which setfattr &>/dev/null || { skip_env "could not find setfattr" && exit 0; }
 
-if [ ! -x `which $LFSCK_BIN` ]; then
-    log "$($E2FSCK -V)"
-    error "e2fsprogs does not support lfsck"
-fi
-
 MOUNT_2=""
 check_and_setup_lustre
 
@@ -219,9 +214,9 @@ init_logging
 # get the server target devices
 get_svr_devs
 
+TESTDIR=$DIR/d0.$TESTSUITE
 if is_empty_fs $MOUNT; then
     # create test directory
-    TESTDIR=$DIR/d0.$TESTSUITE
     mkdir -p $TESTDIR || error "mkdir $TESTDIR failed"
 
     # create some dirs and files on the filesystem
@@ -290,5 +285,14 @@ else
 fi
 
 complete $SECONDS
+# The test directory contains some files referencing to some object
+# which could cause error when removing the directory.
+RMCNT=0
+while [ -d $TESTDIR ]; do
+       RMCNT=$((RMCNT + 1))
+       rm -fr $TESTDIR || echo "$RMCNT round: rm $TESTDIR failed"
+       [ $RMCNT -ge 10 ] && error "cleanup $TESTDIR failed $RMCNT times"
+       remount_client $MOUNT
+done
 check_and_cleanup_lustre
 exit_status