+[ "$MKDIRMANY" ] || MKDIRMANY=$SRCDIR/../tests/mkdirmany
+
+while [ "$1" ]; do
+ case $1 in
+ *.xml) export NAME=`echo $1 | sed "s/.xml//"` ;;
+ esac
+ shift
+done
+
+MOUNT="`mount | awk '/ lustre_lite / { print $3 }' | tail -1`"
+if [ -z "$MOUNT" ]; then
+ sh llmount.sh
+ MOUNT="`mount | awk '/ lustre_lite / { print $3 }' | tail -1`"
+ [ -z "$MOUNT" ] && fail "no lustre filesystem mounted" 1
+ I_MOUNTED="yes"
+fi
+
+OSCTMP=`echo $MOUNT | tr "/" "."`
+USED=`df | awk "/$OSCTMP/ { print \\$3 }" | tail -1`
+USED=`expr $USED + 16` # Some space for the status file
+
+# let's start slowly here...
+log "touching $MOUNT"
+touch $MOUNT || fail "can't touch $MOUNT" 2
+HOSTS=$MOUNT/hosts.$$
+
+if [ $COUNT -gt 10 -o $COUNT -eq 0 ]; then
+ # this will cause the following cp to trigger bug #620096
+ log "create an empty file $HOSTS"
+ mcreate $HOSTS
+ log "copying /etc/hosts to $HOSTS"
+ cp /etc/hosts $HOSTS || fail "can't cp /etc/hosts to $HOSTS" 3
+ log "comparing /etc/hosts and $HOSTS"
+ diff -u /etc/hosts $HOSTS || fail "$HOSTS different" 4
+ log "renaming $HOSTS to $HOSTS.ren"
+ mv $HOSTS $HOSTS.ren || fail "can't rename $HOSTS to $HOSTS.ren" 5
+ log "copying /etc/hosts to $HOSTS again"
+ cp /etc/hosts $HOSTS || fail "can't cp /etc/hosts to $HOSTS again" 6
+ log "truncating $HOSTS"
+ > $HOSTS || fail "can't truncate $HOSTS" 8
+ log "removing $HOSTS"
+ rm $HOSTS || fail "can't remove $HOSTS" 9
+fi
+
+DST=$MOUNT/runtest.$$