1# #-- doh_downstream.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 9if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else skip_test "test skipped"; fi 10get_random_port 1 11UNBOUND_PORT=$RND_PORT 12echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test 13 14# make config file 15sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < doh_downstream_endpoint.conf > ub.conf 16# start unbound in the background 17$PRE/unbound -vvvv -d -c ub.conf >unbound.log 2>&1 & 18UNBOUND_PID=$! 19echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test 20 21cat .tpkg.var.test 22wait_unbound_up unbound.log 23 24