Whamcloud - gitweb
LU-9899 tests: mount client on MGS for tests with pools
[fs/lustre-release.git] / lustre / tests / scrub-performance.sh
index 0c029e7..785335a 100644 (file)
@@ -13,14 +13,17 @@ init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
+[ "$SLOW" = "no" ] &&
+       skip "skip scrub performance test under non-SLOW mode" && exit 0
+
 [ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
-       skip "OI scrub performance only for ldiskfs" && exit 0
+       skip "ldiskfs only test" && exit 0
 [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.2.90) ]] &&
        skip "Need MDS version at least 2.2.90" && exit 0
 require_dsh_mds || exit 0
 
 NTHREADS=${NTHREADS:-0}
-UNIT=${UNIT:-0}
+UNIT=${UNIT:-1048576}
 BACKUP=${BACKUP:-0}
 MINCOUNT=${MINCOUNT:-8192}
 MAXCOUNT=${MAXCOUNT:-32768}
@@ -35,14 +38,25 @@ remote_mds && ECHOCMD=${RCMD} || ECHOCMD="eval"
 
 if [ ${NTHREADS} -eq 0 ]; then
        CPUCORE=$(${RCMD} cat /proc/cpuinfo | grep "processor.*:" | wc -l)
-       NTHREADS=$((CPUCORE * 3))
+       NTHREADS=$((CPUCORE * 2))
 fi
 
 stopall
+
+if ! combined_mgs_mds ; then
+       do_rpc_nodes $(facet_active_host mgs) load_modules_local
+       add mgs $(mkfs_opts mgs $(mgsdevname)) --backfstype ldiskfs \
+               --reformat $(mgsdevname) $(mgsvdevname) ${quiet:+>/dev/null} ||
+               exit 1
+
+       start mgs $(mgsdevname) $MGS_MOUNT_OPTS || error "Fail to start MGS!"
+fi
+
 do_rpc_nodes $(facet_active_host $SINGLEMDS) load_modules_local
-reformat_external_journal
-add $SINGLEMDS $(mkfs_opts $SINGLEMDS) --backfstype ldiskfs --reformat \
-       $MDT_DEVNAME > /dev/null || exit 2
+reformat_external_journal ${SINGLEMDS}
+add ${SINGLEMDS} $(mkfs_opts ${SINGLEMDS} ${MDT_DEVNAME}) --backfstype ldiskfs \
+       --reformat ${MDT_DEVNAME} $(mdsvdevname 1) ${quiet:+>/dev/null} ||
+       exit 2
 
 scrub_attach() {
        ${ECHOCMD} "${LCTL} <<-EOF
@@ -83,7 +97,11 @@ scrub_create() {
 }
 
 scrub_cleanup() {
+       stopall
        do_rpc_nodes $(facet_active_host $SINGLEMDS) unload_modules
+       if ! combined_mgs_mds ; then
+               do_rpc_nodes $(facet_active_host mgs) unload_modules
+       fi
        formatall
 }
 
@@ -141,7 +159,8 @@ test_0() {
                if [ ${BACKUP} -ne 0 ]; then
                        stime=$(date +%s)
                        echo "backup/restore ${i} files start at: $(date)"
-                       mds_backup_restore || error "Fail to backup/restore!"
+                       mds_backup_restore $SINGLEMDS ||
+                               error "Fail to backup/restore!"
                        echo "backup/restore ${i} files end at: $(date)"
                        etime=$(date +%s)
                        delta=$((etime - stime))
@@ -149,7 +168,8 @@ test_0() {
                        echo "backup/restore ${i} files used ${delta} seconds"
                        echo "backup/restore speed is $((i / delta))/sec"
                else
-                       mds_remove_ois || error "Fail to remove/recreate!"
+                       mds_remove_ois $SINGLEMDS ||
+                               error "Fail to remove/recreate!"
                fi
 
                echo "--- start to rebuild OI for $i files set at: $(date) ---"