mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-21 07:10:43 -05:00
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
39 lines
988 B
Text
39 lines
988 B
Text
# #-- pylib.pre--#
|
|
# 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="../.."
|
|
. ../common.sh
|
|
# if no python; exit
|
|
if grep "define WITH_PYUNBOUND 1" $PRE/config.h; then
|
|
echo "have pyunbound"
|
|
else
|
|
echo "no pyunbound"
|
|
exit 0
|
|
fi
|
|
|
|
# Copy the required libraries
|
|
cp $PRE/libunbound/python/unbound.py .
|
|
cp $PRE/.libs/_unbound* .
|
|
cp $PRE/.libs/libunbound* .
|
|
|
|
get_random_port 2
|
|
UNBOUND_PORT=$RND_PORT
|
|
FWD_PORT=$(($RND_PORT + 1))
|
|
echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
|
|
echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
|
|
|
|
# start forwarder
|
|
get_ldns_testns
|
|
$LDNS_TESTNS -p $FWD_PORT pylib.testns >fwd.log 2>&1 &
|
|
FWD_PID=$!
|
|
echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
|
|
|
|
# modify config file
|
|
sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < pylib.lookup.conf > ub.lookup.conf
|
|
|
|
cat .tpkg.var.test
|
|
wait_ldns_testns_up fwd.log
|
|
|