1 # #-- dnscrypt_cert_chacha.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
10 # Check if we can run the test.
14 UNBOUND_PORT=$RND_PORT
15 FWD_PORT=$(($RND_PORT + 1))
16 DNSCRYPT_PORT=$(($RND_PORT + 2))
17 echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
18 echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
19 echo "DNSCRYPT_PORT=$DNSCRYPT_PORT" >> .tpkg.var.test
23 $LDNS_TESTNS -p $FWD_PORT dnscrypt_cert_chacha.testns >fwd.log 2>&1 &
25 echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
28 sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' \
29 -e 's/@DNSCRYPT_PORT\@/'$DNSCRYPT_PORT'/' < dnscrypt_cert_chacha.conf > ub.conf
30 # start unbound in the background
31 $PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
33 echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
36 wait_ldns_testns_up fwd.log
37 if [ $xchacha20 -eq 0 ]; then
38 # no xchacha20 support, we expect unbound to exit with an error message.
39 wait_server_up unbound.log "Certificate for XChacha20 but libsodium does not support it"
41 wait_unbound_up unbound.log