Vendor import of Unbound 1.12.0.
[freebsd.git] / testdata / doh_downstream_buffer_size.tdir / doh_downstream_buffer_size.test
1 # #-- doh_downstream.test --#
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 PRE="../.."
8 . ../common.sh
9 if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi
10 get_make
11 (cd $PRE; $MAKE dohclient)
12
13
14 echo "> query www.example.net. endpoint /dns-query"
15 $PRE/dohclient -s 127.0.0.1 -p $UNBOUND_PORT 1.example.net. A IN 2.example.net. A IN 3.example.net. A IN 4.example.net. A IN 5.example.net. A IN 6.example.net. A IN 7.example.net. A IN 8.example.net. A IN 9.example.net. A IN 10.example.net. A IN  >outfile 2>&1
16 cat outfile
17 if test "$?" -ne 0; then
18         echo "exit status not OK"
19         echo "> cat logfiles"
20         cat outfile
21         cat unbound.log
22         echo "Not OK"
23         exit 1
24 fi
25 num=$(grep "ANSWER SEC" outfile | wc -l)
26 # 58 byte answers, 500 byte max response buffer -> 8 answers
27 if [ $num -eq 8 ]; then
28         echo "content OK"
29 else
30         echo "result contents not OK"
31         echo "> cat logfiles"
32         cat outfile
33         cat unbound.log
34         echo "result contents not OK"
35         exit 1
36 fi
37 echo "OK"
38
39 exit 0