Whamcloud - gitweb
LU-427 test: Test failure on test suite lfsck
[fs/lustre-release.git] / lustre / tests / runtests
index 64426d1..1416303 100755 (executable)
@@ -13,6 +13,7 @@ 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=1000
@@ -53,7 +54,7 @@ if [ $COUNT -gt 10 -o $COUNT -eq 0 ]; then
        rm $HOSTS || error "can't remove $HOSTS" 9
        cp /etc/hosts $HOSTS.2 || error "can't cp /etc/hosts to $HOSTS.2" 7
        log "truncating $HOSTS.2 to $TRUNCSIZE bytes"
-       truncate $HOSTS.2 $TRUNCSIZE
+       $TRUNCATE $HOSTS.2 $TRUNCSIZE
 fi
 
 DST=$MOUNT/runtest.$$
@@ -64,8 +65,8 @@ mkdir $DST || error "can't mkdir $DST" 10
 # ok, that hopefully worked, so let's do a little more, with files that
 # haven't changed in the last day (hopefully they don't change during test)
 FILES=$TMP/runtests.files
-# print0 is to use "NUL" instead of newline as filename terminator, bug 19702 
-find $RUNTESTS_SRC -type f -mtime +1 -print0 | head -n $COUNT > $FILES
+# use "NUL" instead of newline as filename terminator, bug 19702 
+find $RUNTESTS_SRC -type f -mtime +1 | head -n $COUNT | tr '\n' '\0' > $FILES
 [ -s "$FILES" ] || error "$RUNTESTS_SRC contains only files modifed less than 2 days ago"
 
 log "copying files from $RUNTESTS_SRC to $DST$RUNTESTS_SRC at `date`"
@@ -123,5 +124,7 @@ if [ `expr $NOWUSED - $USED` -gt 1024 ]; then
        echo "Space not all freed: now ${NOWUSED}kB, was ${USED}kB." 1>&2
 fi
 
+complete $(basename $0) $SECONDS
 rm -f $FILES
 check_and_cleanup_lustre
+exit_status