xref: /freebsd/contrib/unbound/testdata/auth_tls_failcert.tdir/auth_tls_failcert.pre (revision be771a7b7f4580a30d99e41a5bb1b93a385a119d)
1# #-- auth_tls_failcert.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#skip_test "Skip test due to no UDP service for SOA query"
9PRE="../.."
10if test -n "$NSD"; then
11	:
12else
13	if `which nsd >/dev/null 2>&1`; then
14		# need nsd >= 4.2.0
15		NSD="nsd"
16	else
17		if test -f $PRE/../nsd/nsd; then
18			NSD="$PRE/../nsd/nsd"
19		else
20			skip_test "need nsd"
21		fi
22	fi
23fi
24echo "NSD=$NSD"
25
26get_random_port 2
27UNBOUND_PORT=$RND_PORT
28NSD_PORT=$(($RND_PORT + 1))
29echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
30echo "NSD_PORT=$NSD_PORT" >> .tpkg.var.test
31
32# make config file
33sed -e 's/@UNBOUND_PORT\@/'$UNBOUND_PORT'/' -e 's/@NSD_PORT\@/'$NSD_PORT'/' < auth_tls_failcert.ub.conf > ub.conf
34sed -e 's/@UNBOUND_PORT\@/'$UNBOUND_PORT'/' -e 's/@NSD_PORT\@/'$NSD_PORT'/' < auth_tls_failcert.nsd.conf > nsd.conf
35
36# start nsd
37$NSD -d -c nsd.conf >nsd.log 2>&1 &
38NSD_PID=$!
39echo "NSD_PID=$NSD_PID" >> .tpkg.var.test
40
41# start unbound in the background
42$PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
43UNBOUND_PID=$!
44echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
45
46cat .tpkg.var.test
47wait_nsd_up nsd.log
48wait_unbound_up unbound.log
49