3 export NAME=${NAME:-local}
6 MOUNT=${MOUNT:-/mnt/lustre}
15 FREESPACE=`df |grep $MOUNT|tr -s ' '|cut -d ' ' -f4`
18 dd if=/dev/zero of=$MOUNT/oosfile count=$[$FREESPACE + 1] bs=1k 2>$TMP/oosfile
20 RECORDSOUT=`grep "records out" $TMP/oosfile|cut -d + -f1`
22 [ -z "`grep "No space left on device" $TMP/oosfile`" ] && \
23 echo "failed:dd not return ENOSPC" && SUCCESS=0
25 REMAINEDFREE=`df |grep $MOUNT|tr -s ' '|cut -d ' ' -f4`
26 [ $[$FREESPACE - $REMAINEDFREE ] -lt $RECORDSOUT ] && \
27 echo "failed:the space written by dd not equal to available space" && \
28 SUCCESS=0 && echo "$FREESPACE - $REMAINEDFREE $RECORDSOUT"
30 [ $REMAINEDFREE -gt 100 ] && \
31 echo "failed:too many space left $REMAINEDFREE and -ENOSPC returned" &&\
34 FILESIZE=`ls -l $MOUNT/oosfile|tr -s ' '|cut -d ' ' -f5`
35 [ $RECORDSOUT -ne $[$FILESIZE/1024] ] && \
36 echo "failed:the space written by dd not equal to the size of file" && \
39 [ $SUCCESS -eq 1 ] && echo "Success!"