check_mdstat.sh/test/run.sh
2020-02-08 17:34:42 +00:00

23 lines
423 B
Bash
Executable file

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