1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#
# Common code for checking address translation maps
#
mkdir -p out || exit 99
name=$( basename "$0" )
resultfile="out/${name}.result"
expectfile="$srcdir/$name.expect"
echo -n "Checking $input... "
./addrmap $input >"$resultfile"
rc=$?
if [ $rc -gt 1 ]; then
echo ERROR
echo "Cannot set $input" >&2
exit $rc
elif [ $rc -ne 0 ]; then
echo FAILED
exit $rc
elif ! diff "$expectfile" "$resultfile"; then
echo FAILED
echo "Result does not match" >&2
exit 1
else
echo OK
fi
exit 0
|