xref: /freebsd/contrib/unbound/testdata/fast_reload_thread.tdir/fast_reload_thread.pre (revision b670c9bafc0e31c7609969bf374b2e80bdc00211)
1# #-- fast_reload_thread.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
7PRE="../.."
8. ../common.sh
9# if no threads; exit
10if grep -e "define HAVE_PTHREAD 1" -e "define HAVE_SOLARIS_THREADS 1" -e "define HAVE_WINDOWS_THREADS 1" $PRE/config.h; then
11	echo "have threads"
12else
13	skip_test "no threads"
14fi
15
16get_random_port 1
17UNBOUND_PORT=$RND_PORT
18echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
19
20# make config file
21CONTROL_PATH=/tmp
22CONTROL_PID=$$
23sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's?@CONTROL_PATH\@?'$CONTROL_PATH'?' -e 's/@CONTROL_PID@/'$CONTROL_PID'/' < fast_reload_thread.conf > ub.conf
24# start unbound in the background
25PRE="../.."
26$PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
27UNBOUND_PID=$!
28echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
29echo "CONTROL_PATH=$CONTROL_PATH" >> .tpkg.var.test
30echo "CONTROL_PID=$CONTROL_PID" >> .tpkg.var.test
31
32cat .tpkg.var.test
33wait_unbound_up unbound.log
34
35