diff options
Diffstat (limited to 'testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.test')
-rw-r--r-- | testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.test | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.test b/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.test new file mode 100644 index 0000000000000..2a6954cab6457 --- /dev/null +++ b/testdata/doh_downstream_endpoint.tdir/doh_downstream_endpoint.test @@ -0,0 +1,59 @@ +# #-- doh_downstream.test --# +# source the master var file when it's there +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +# use .tpkg.var.test for in test variable passing +[ -f .tpkg.var.test ] && source .tpkg.var.test + +PRE="../.." +. ../common.sh +if grep "define HAVE_NGHTTP2 1" $PRE/config.h; then echo test enabled; else echo test skipped; exit 0; fi +get_make +(cd $PRE; $MAKE dohclient) + + +echo "> query www.example.net. endpoint /dns-query" +$PRE/dohclient -s 127.0.0.1 -p $UNBOUND_PORT www.example.net. A IN >outfile 2>&1 +cat outfile +if test "$?" -ne 0; then + echo "exit status not OK" + echo "> cat logfiles" + cat outfile + cat unbound.log + echo "Not OK" + exit 1 +fi +if grep "status 404" outfile; then + echo "content OK" +else + echo "result contents not OK" + echo "> cat logfiles" + cat outfile + cat unbound.log + echo "result contents not OK" + exit 1 +fi +echo "OK" + +echo "> query www.example.net. endpoint /abc" +$PRE/dohclient -e /abc -s 127.0.0.1 -p $UNBOUND_PORT www.example.net. A IN >outfile 2>&1 +cat outfile +if test "$?" -ne 0; then + echo "exit status not OK" + echo "> cat logfiles" + cat outfile + cat unbound.log + echo "Not OK" + exit 1 +fi +if grep ":status 200" outfile; then + echo "content OK" +else + echo "result contents not OK" + echo "> cat logfiles" + cat outfile + cat unbound.log + echo "result contents not OK" + exit 1 +fi +echo "OK" +exit 0 |