Whamcloud - gitweb
LU-1538 tests: standardize test script init - dne-part-2
[fs/lustre-release.git] / lustre / tests / runtests
index b722aca..6e80caf 100755 (executable)
@@ -1,31 +1,23 @@
 #!/bin/bash
 #
 # Script which does some basic tests to ensure we haven't regressed.
-# Probably a good idea to run this before doing any checkins.
-# In the future this can become more fancy, but it's OK for now.
 
 LUSTRE=${LUSTRE:-$(dirname $0)/..}
-SRCDIR="$(dirname $0)"
-export PATH=/sbin:/usr/sbin:$SRCDIR:$SRCDIR/../utils:$PATH
-
-export NAME=${NAME:-local}
-
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
 
 RUNTESTS_SRC=${RUNTESTS_SRC:-"/etc /bin"}
 [ "$COUNT" ] || COUNT=10000
 [ "$SLOW" = "no" ] && COUNT=1000
 
-[ "$MCREATE" ] || MCREATE=mcreate
-
 [ "$MKDIRMANY" ] || MKDIRMANY="createmany -d"
 [ "$RMDIRMANY" ] || RMDIRMANY="unlinkmany -d"
 
 check_and_setup_lustre
+
 test_1() {
+sleep 5 # let MDS refresh aggregated statfs
 # Include some extra space for the status file
 USED=$(df -P $DIR | awk '{ print $3 }' | tail -n 1)
 
@@ -127,8 +119,9 @@ $RMDIRMANY $DST/d 100 || error "$RMDIRMANY cleanup failed"
 log "done"
 
 wait_delete_completed
+sleep 5 # let MDS refresh aggregated statfs
 NOWUSED=$(($(df -P $DIR | awk '{ print $3 }' | tail -n 1)))
-if [ $(expr $NOWUSED - $USED) -gt 1024 ]; then
+if [ $(expr $NOWUSED - $USED) -gt $(fs_log_size) ]; then
        error "Space not all freed: now ${NOWUSED}kB, was ${USED}kB."
 else
        log "Space was freed: now ${NOWUSED}kB, was ${USED}kB."