dir="`dirname $0`" ERROR=false for f in `ls $dir/*.input`; do RESULT="`$dir/../check_mdstat.sh --raid md0 --input $f`" EXPECTED="`cat $dir/$(basename $f .input).output`" if [ "$RESULT" != "$EXPECTED" ]; then echo "Error for test $(basename $f .input):" echo " Expected" echo " $EXPECTED" echo " and got" echo " $RESULT" ERROR=true fi done if $ERROR; then exit 1; else echo "Tests passed." exit 0; fi