check_mdstat.sh/test/run.sh

24 lines
449 B
Bash
Raw Normal View History

2020-02-08 18:34:42 +01:00
dir="`dirname $0`"
ERROR=false
2020-11-29 11:31:21 +01:00
IFS=$'\n'
for f in `find $dir -type d -name '*.input'`; do
2020-02-08 18:34:42 +01:00
RESULT="`$dir/../check_mdstat.sh --raid md0 --input $f`"
2020-11-29 11:31:21 +01:00
EXPECTED="$(<$dir/$(basename $f .input).output)"
2020-02-08 18:34:42 +01:00
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