check_mdstat.sh/test/run.sh

24 lines
449 B
Bash
Executable File

dir="`dirname $0`"
ERROR=false
IFS=$'\n'
for f in `find $dir -type d -name '*.input'`; do
RESULT="`$dir/../check_mdstat.sh --raid md0 --input $f`"
EXPECTED="$(<$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