Home | History | Annotate | Line # | Download | only in ffs
      1 #!/bin/sh
      2 ##  First arg is expected number of blocks.  Rest are args to be passed to dump.
      3 expectedest=$1
      4 shift
      5 
      6 echo "Expecting estimate around $expectedest blocks:"
      7 est=`/sbin/dump $* 2>&1 | grep estimated`
      8 echo $est
      9 blkest=`echo $est | awk '{print $3;}'`
     10 
     11 diff=`echo $expectedest $blkest |\
     12     awk '{if ($1<$2) print $2-$1; else print $1-$2;}'`
     13 
     14 thresh=10
     15 ##  Use an error threshold of $thresh blocks.  The error could arise from
     16 ##  one machine with a larger / and /tmp than the system on which this
     17 ##  test was developed.
     18 
     19 if [ $diff -gt $thresh ]; then
     20   echo "Error:  estimated $blkest blocks!"
     21   exit 1
     22 fi
     23