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 [ $FREESPACE -lt $RECORDSOUT ] && \
26 echo "failed:the space written by dd larger than available space" && \
29 FILESIZE=`ls -l $MOUNT/oosfile|tr -s ' '|cut -d ' ' -f5`
30 [ $RECORDSOUT -ne $[$FILESIZE/1024] ] && \
31 echo "failed:the space written by dd not equal to the size of file" && \
34 [ $SUCCESS -eq 1 ] && echo "Success!"