check_nmap.sh/test/run.sh

24 lines
437 B
Bash
Executable File

dir="`dirname $0`"
ERROR=false
for f in `ls $dir/*.input`; do
RESULT="`$dir/../check_nmap.sh --input $f --known 25 --known 80`"
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