mirror of
https://github.com/NLnetLabs/unbound.git
synced 2024-09-21 22:57:08 +00:00
5853f90076
PYTHON_VERSION=3.6 or with 2.7 unbound can compile and unit tests succeed for the python module. - pythonmod logs the python error and traceback on failure. git-svn-id: file:///svn/unbound/trunk@4966 be551aaa-1e26-0410-a405-d3ace91eadb9
73 lines
1.6 KiB
Plaintext
73 lines
1.6 KiB
Plaintext
# #-- 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:."
|
|
|
|
if grep "PY_MAJOR_VERSION=3" $PRE/Makefile; then
|
|
PYTHON="python3"; else PYTHON="python2"; fi
|
|
if test ! -x `which $PYTHON` 2>&1; then PYTHON="python"; fi
|
|
|
|
# do the test
|
|
echo "> pylib.lookup.py www.example.com."
|
|
$PYTHON 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
|