1# #-- stub_udp6.pre--#
2# source the master var file when it's there
3[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
4# use .tpkg.var.test for in test variable passing
5[ -f .tpkg.var.test ] && source .tpkg.var.test
6
7. ../common.sh
8get_random_port 2
9UNBOUND_PORT=$RND_PORT
10FWD_PORT=$(($RND_PORT + 1))
11echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
12echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
13
14# start forwarder
15get_ldns_testns
16$LDNS_TESTNS -6 -p $FWD_PORT stub_udp6.testns >fwd.log 2>&1 &
17FWD_PID=$!
18echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
19
20# make config file
21sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < stub_udp6.conf > ub.conf
22# start unbound in the background
23PRE="../.."
24$PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
25UNBOUND_PID=$!
26echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
27
28cat .tpkg.var.test
29wait_ldns_testns_up fwd.log
30wait_unbound_up unbound.log
31
32