xref: /netbsd-src/external/bsd/unbound/dist/testdata/ede.tdir/ede.pre (revision 06dfa8449cb5e76c0044ec0f3badf7d5180af0f5)
1# #-- ede.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
10UNBOUND_PORT2=$(($RND_PORT + 1))
11echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
12echo "UNBOUND_PORT2=$UNBOUND_PORT2" >> .tpkg.var.test
13
14# rewrite config file with created ports
15sed -e 's/@PORT\@/'$UNBOUND_PORT'/' < ede.conf > temp.conf
16sed -e 's/@PORT2\@/'$UNBOUND_PORT2'/' < temp.conf > ub.conf
17sed -e 's/@PORT2\@/'$UNBOUND_PORT2'/' < ede-auth.conf > ub2.conf
18
19# create broken dnssec zone
20bogus/make-broken-zone.sh
21
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
28# start authoritative unbound in the background
29$PRE/unbound -d -c ub2.conf > unbound2.log 2>&1 &
30UNBOUND_PID2=$!
31echo "UNBOUND_PID2=$UNBOUND_PID2" >> .tpkg.var.test
32
33
34cat .tpkg.var.test
35wait_unbound_up unbound.log
36wait_unbound_up unbound2.log
37
38