xref: /netbsd-src/external/bsd/unbound/dist/testdata/fwd_ancil.tdir/fwd_ancil.pre (revision 4439cfd0acf9c7dc90625e5cd83b2317a9ab8967)
1# #-- fwd_ancil.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. ../common.sh
7
8if test `hostname`"" = "dicht.nlnetlabs.nl"; then
9	skip_test "In jail, no ::1, skip test"
10fi
11
12get_random_port 2
13UNBOUND_PORT=$RND_PORT
14FWD_PORT=$(($RND_PORT + 1))
15echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
16echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
17
18# start forwarder
19get_ldns_testns
20$LDNS_TESTNS -p $FWD_PORT fwd_ancil.testns >fwd.log 2>&1 &
21FWD_PID=$!
22echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
23
24# make config file
25sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < fwd_ancil.conf > ub.conf
26# start unbound in the background
27PRE="../.."
28$PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
29UNBOUND_PID=$!
30echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
31
32cat .tpkg.var.test
33
34wait_ldns_testns_up fwd.log
35
36# wait for unbound to come up
37# string 'Start of service' in log.
38wait_server_up_or_fail unbound.log "start of service" "disable interface-automatic"
39if fgrep "disable interface-automatic" unbound.log; then
40	skip_test "skip test"
41fi
42
43