1 # #-- ssl_req_timeout.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)
11 # check what sort of netcat we have
12 if nc -h 2>&1 | grep "q secs"; then
18 # this test query should just work (server is up)
19 echo "> query www1.example.net."
20 $PRE/streamtcp -s -f 127.0.0.1@$UNBOUND_PORT www1.example.net. A IN >outfile 2>&1
22 if test "$?" -ne 0; then
23 echo "exit status not OK"
31 if grep "www1.example.net" outfile | grep "1.2.3.1"; then
34 echo "result contents not OK"
39 echo "result contents not OK"
44 # multiple requests that are answered immediately and then the timeout
45 echo "> query www1.example.net. www2.example.net. www3.example.net. www.example.com."
46 $PRE/streamtcp -a -s -f 127.0.0.1@$UNBOUND_PORT www1.example.net. A IN www2.example.net A IN www3.example.net A IN www.example.com. A IN >outfile 2>&1
48 if test "$?" -ne 0; then
49 echo "exit status not OK"
57 if grep "www1.example.net" outfile | grep "1.2.3.1"; then
60 echo "result contents not OK"
65 echo "result contents not OK"
68 if grep "www2.example.net" outfile | grep "1.2.3.2"; then
71 echo "result contents not OK"
76 echo "result contents not OK"
79 if grep "www3.example.net" outfile | grep "1.2.3.3"; then
82 echo "result contents not OK"
87 echo "result contents not OK"
90 if grep "stream closed" outfile; then
93 echo "result contents not OK"
98 echo "result contents not OK"
102 # multiple requests that are waiting for answers and then the timeout
103 echo "> query www2.example.com. www2.example.com. www3.example.com."
104 $PRE/streamtcp -a -s -f 127.0.0.1@$UNBOUND_PORT www2.example.com. A IN www2.example.com A IN www3.example.com A IN >outfile 2>&1
106 if test "$?" -ne 0; then
107 echo "exit status not OK"
108 echo "> cat logfiles"
115 if grep "stream closed" outfile; then
118 echo "result contents not OK"
119 echo "> cat logfiles"
123 echo "result contents not OK"
130 # echo a couple requests to the other side and then wait for the timeout.
131 # this creates waiting answers in the reply queue.
132 echo "> nc www.example.net www2.example.net www3.example.net"
133 ( echo "0021eb410100000100000000000003777777076578616d706c65036e657400000100010022eb41010000010000000000000477777732076578616d706c65036e657400000100010022eb41010000010000000000000477777733076578616d706c65036e65740000010001" | xxd -r -p ; sleep 10 ; echo "") | nc $ncopt --ssl 127.0.0.1 $UNBOUND_PORT | xxd | tee outfile