]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - testdata/09-unbound-control.tdir/09-unbound-control.pre
Vendor import of Unbound 1.6.6.
[FreeBSD/FreeBSD.git] / testdata / 09-unbound-control.tdir / 09-unbound-control.pre
1 # #-- 09-unbound-control.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
8 get_random_port 3
9 UNBOUND_PORT=$RND_PORT
10 FWD_PORT=$(($RND_PORT + 1))
11 CONTROL_PORT=$(($RND_PORT + 2))
12 echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
13 echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
14 echo "CONTROL_PORT=$CONTROL_PORT" >> .tpkg.var.test
15
16 # start forwarder
17 get_ldns_testns
18 $LDNS_TESTNS -p $FWD_PORT 09-unbound-control.testns >fwd.log 2>&1 &
19 FWD_PID=$!
20 echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
21
22 # make config file
23 sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' -e 's/@CONTROL_PORT\@/'$CONTROL_PORT'/' < 09-unbound-control.conf > ub.conf
24 # start unbound in the background
25 PRE="../.."
26 $PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
27 UNBOUND_PID=$!
28 echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
29
30 cat .tpkg.var.test
31 wait_ldns_testns_up fwd.log
32 wait_unbound_up unbound.log
33