mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-10-17 14:05:12 +02:00
75 lines
2.0 KiB
Plaintext
75 lines
2.0 KiB
Plaintext
# #-- auth_load_list.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 threads; exit
|
|
if grep -e "define HAVE_PTHREAD 1" -e "define HAVE_SOLARIS_THREADS 1" -e "define HAVE_WINDOWS_THREADS 1" $PRE/config.h; then
|
|
echo "have threads"
|
|
else
|
|
skip_test "no threads"
|
|
fi
|
|
|
|
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
|
|
|
|
# create auth_load_list.testns
|
|
for((i=1; i<16; i++)); do
|
|
cat >>auth_load_list.testns <<EOF
|
|
|
|
ENTRY_BEGIN
|
|
MATCH opcode qtype qname
|
|
ADJUST copy_id
|
|
REPLY QR AA NOERROR
|
|
SECTION QUESTION
|
|
example$i.com. IN SOA
|
|
SECTION ANSWER
|
|
example$i.com. IN SOA ns.example$i.com. hostmaster.example$i.com. 1 3600 900 86400 3600
|
|
ENTRY_END
|
|
|
|
ENTRY_BEGIN
|
|
MATCH opcode qtype qname
|
|
ADJUST copy_id
|
|
REPLY QR AA NOERROR
|
|
SECTION QUESTION
|
|
example$i.com. IN AXFR
|
|
SECTION ANSWER
|
|
example$i.com. IN SOA ns.example$i.com. hostmaster.example$i.com. 1 3600 900 86400 3600
|
|
example$i.com. IN NS ns.example.net.
|
|
EXTRA_PACKET
|
|
REPLY QR AA NOERROR
|
|
SECTION QUESTION
|
|
example$i.com. IN AXFR
|
|
SECTION ANSWER
|
|
www.example$i.com. IN A 1.2.3.4
|
|
example$i.com. IN SOA ns.example$i.com. hostmaster.example$i.com. 1 3600 900 86400 3600
|
|
ENTRY_END
|
|
EOF
|
|
done
|
|
|
|
get_ldns_testns
|
|
$LDNS_TESTNS -p $FWD_PORT auth_load_list.testns >fwd.log 2>&1 &
|
|
FWD_PID=$!
|
|
echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
|
|
|
|
# make config file
|
|
sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < auth_load_list.conf > ub.conf
|
|
# start unbound in the background
|
|
$PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
|
|
#valgrind --leak-check=full --show-reachable=yes $PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
|
|
UNBOUND_PID=$!
|
|
echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
|
|
|
|
cat .tpkg.var.test
|
|
wait_ldns_testns_up fwd.log
|
|
wait_unbound_up unbound.log
|
|
|