Whamcloud - gitweb
LU-11716 tests: fix scrub tests
[fs/lustre-release.git] / lustre / tests / sanity-scrub.sh
index 24c81a9..ffff7a0 100644 (file)
@@ -27,7 +27,7 @@ if ! check_versions; then
        exit 0
 fi
 
-stopall
+cleanupall
 
 SAVED_MDSSIZE=${MDSSIZE}
 SAVED_OSTSIZE=${OSTSIZE}
@@ -43,8 +43,7 @@ OSTSIZE=200000
 [ $OSTCOUNT -gt 4 ] && OSTCOUNT=4
 
 # build up a clean test environment.
-formatall
-setupall
+REFORMAT="yes" check_and_setup_lustre
 
 build_test_filter
 
@@ -107,8 +106,10 @@ scrub_prep() {
                        error "Failed to copy files to mds$n"
                mkdir -p $DIR/$tdir/mds$n/d_$tfile ||
                        error "mkdir failed on mds$n"
-               createmany -m $DIR/$tdir/mds$n/d_$tfile/f 2 > \
+               touch $DIR/$tdir/mds$n/d_$tfile/f1 > \
                        /dev/null || error "create failed on mds$n"
+               dd if=/dev/zero of=$DIR/$tdir/mds$n/d_$tfile/f2 bs=1M count=1 ||
+                       error "write failed on mds$n"
                if [[ $nfiles -gt 0 ]]; then
                        createmany -m $DIR/$tdir/mds$n/$tfile $nfiles > \
                                /dev/null || error "createmany failed on mds$n"
@@ -1249,7 +1250,8 @@ OSTSIZE=${SAVED_OSTSIZE}
 OSTCOUNT=${SAVED_OSTCOUNT}
 
 # cleanup the system at last
-formatall
+REFORMAT="yes" cleanup_and_setup_lustre
 
 complete $SECONDS
+check_and_cleanup_lustre
 exit_status