1 # #-- tcp_req_size.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
10 (cd $PRE; $MAKE streamtcp)
12 # this test query should just work (server is up)
13 echo "> query www1.example.net."
14 $PRE/streamtcp -f 127.0.0.1@$UNBOUND_PORT www1.example.net. A IN >outfile 2>&1
16 if test "$?" -ne 0; then
17 echo "exit status not OK"
25 if grep "www1.example.net" outfile | grep "1.2.3.1"; then
28 echo "result contents not OK"
33 echo "result contents not OK"
38 # out of order requests, the example.com elements take 2 seconds to wait.
39 # www3.example.com present twice, answered twice.
40 # this queues one answer in the wait buffers, and that exceeds the buffer.
42 echo "> query www1.example.net. www3.example.com. www2.example.net. www3.example.com. www3.example.net."
43 $PRE/streamtcp -a -f 127.0.0.1@$UNBOUND_PORT www1.example.net. A IN www3.example.com. A IN www2.example.net A IN www3.example.com. A IN www3.example.net A IN >outfile 2>&1
45 if test "$?" -ne 0; then
46 echo "exit status not OK"
54 if grep "www1.example.net" outfile | grep "1.2.3.1"; then
57 echo "result contents not OK"
62 echo "result contents not OK"
65 if grep "www2.example.net" outfile | grep "1.2.3.2"; then
68 echo "result contents not OK"
73 echo "result contents not OK"
76 if grep "www3.example.net" outfile | grep "1.2.3.3"; then
79 echo "result contents not OK"
84 echo "result contents not OK"
87 if grep "stream closed" outfile; then
90 echo "result contents not OK"
95 echo "result contents not OK"
100 # check that the server is still up
102 echo "> query www1.example.net. (again check if server up)"
103 $PRE/streamtcp -f 127.0.0.1@$UNBOUND_PORT www1.example.net. A IN >outfile 2>&1
105 if test "$?" -ne 0; then
106 echo "exit status not OK"
107 echo "> cat logfiles"
114 if grep "www1.example.net" outfile | grep "1.2.3.1"; then
117 echo "result contents not OK"
118 echo "> cat logfiles"
122 echo "result contents not OK"