Debian Codegraph @

testdata/stub_udp_with_tcp_upstream.tdir/stub_udp_with_tcp_upstream.pre

raw
1 # #-- stub_udp_with_tcp_upstream.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
8 get_random_port 2
9 UNBOUND_PORT=$RND_PORT
10 FWD_PORT=$(($RND_PORT + 1))
11 echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
12 echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
13
14 # start forwarder
15 get_ldns_testns
16 $LDNS_TESTNS -p $FWD_PORT stub_udp_with_tcp_upstream.testns >fwd.log 2>&1 &
17 FWD_PID=$!
18 echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
19
20 # make config file
21 sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < stub_udp_with_tcp_upstream.conf > ub.conf
22 # start unbound in the background
23 PRE="../.."
24 $PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
25 UNBOUND_PID=$!
26 echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
27
28 cat .tpkg.var.test
29
30 # wait for forwarder to come up
31 wait_ldns_testns_up fwd.log
32
33 # wait for unbound to come up
34 wait_unbound_up unbound.log
35