Whamcloud - gitweb
LU-3367 test: some fixes for lfsck test
[fs/lustre-release.git] / lustre / tests / test-framework.sh
index 9871bf8..8f43e58 100644 (file)
@@ -3533,10 +3533,17 @@ is_empty_dir() {
 
 # empty lustre filesystem may have empty directories lost+found and .lustre
 is_empty_fs() {
+       # exclude .lustre & lost+found
        [ $(find $1 -maxdepth 1 -name lost+found -o -name .lustre -prune -o \
                -print | wc -l) = 1 ] || return 1
        [ ! -d $1/lost+found ] || is_empty_dir $1/lost+found || return 1
-       [ ! -d $1/.lustre ] || is_empty_dir $1/.lustre || return 1
+       if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.4.0) ]; then
+               # exclude .lustre/fid (LU-2780)
+               [ $(find $1/.lustre -maxdepth 1 -name fid -prune -o \
+                       -print | wc -l) = 1 ] || return 1
+       else
+               [ ! -d $1/.lustre ] || is_empty_dir $1/.lustre || return 1
+       fi
        return 0
 }
 
@@ -6084,7 +6091,7 @@ remove_ost_objects() {
        fi
        mount -t $(facet_fstype $facet) $opts $ostdev $mntpt ||
                return $?
-       rc=0;
+       rc=0
        for i in $objids; do
                rm $mntpt/O/$group/d$((i % 32))/$i || { rc=$?; break; }
        done
@@ -6108,7 +6115,7 @@ remove_mdt_files() {
        fi
        mount -t $(facet_fstype $facet) $opts $mdtdev $mntpt ||
                return $?
-       rc=0;
+       rc=0
        for f in $files; do
                rm $mntpt/ROOT/$f || { rc=$?; break; }
        done