unbound/testdata/pylib.tdir/pylib.test
George Thessalonikefs 749d1b9ebc - Expose if a query (or a subquery) was ratelimited (not src IP
ratelimiting) to libunbound under 'ub_result.was_ratelimited'.
  This also introduces a change to 'ub_event_callback_type' in
  libunbound/unbound-event.h.
- Tidy pylib tests.


git-svn-id: file:///svn/unbound/trunk@4828 be551aaa-1e26-0410-a405-d3ace91eadb9
2018-08-03 14:00:46 +00:00

68 lines
1.4 KiB
Text

# #-- pylib.test --#
# source the master var file when it's there
[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
# use .tpkg.var.test for in test variable passing
[ -f .tpkg.var.test ] && source .tpkg.var.test
PRE="../.."
if grep "define WITH_PYUNBOUND 1" $PRE/config.h; then
echo "have pyunbound"
else
echo "no pyunbound"
exit 0
fi
if test "`uname 2>&1`" = "Darwin"; then
echo export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:../../.libs"
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:../../.libs"
fi
#echo export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:../../.libs:."
#export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:../../.libs:."
# do the test
echo "> pylib.lookup.py www.example.com."
./pylib.lookup.py www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
echo "> check answer"
if grep "Resolve: \[.\?10.20.30.40.\?\]" outfile; then
:
else
echo "Not OK (resolve)"
exit 1
fi
if grep "Async resolve: \[.\?10.20.30.40.\?\]" outfile; then
:
else
echo "Not OK (async resolve)"
exit 1
fi
if grep "Ratelimit-fg-on: pass" outfile; then
:
else
echo "Not OK (ratelimit-fg-on)"
exit 1
fi
if grep "Ratelimit-fg-off: \[.\?10.20.30.40.\?\]" outfile; then
:
else
echo "Not OK (ratelimit-fg-off)"
exit 1
fi
if grep "Ratelimit-bg-on: pass" outfile; then
:
else
echo "Not OK (ratelimit-bg-on)"
exit 1
fi
if grep "Ratelimit-bg-off: \[.\?10.20.30.40.\?\]" outfile; then
:
else
echo "Not OK (ratelimit-bg-off)"
exit 1
fi
echo "OK"
exit 0