xref: /netbsd-src/external/bsd/unbound/dist/testdata/stream_ssl.tdir/stream_ssl.test (revision dd3ee07da436799d8de85f3055253118b76bf345)
1# #-- stream_ssl.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
7PRE="../.."
8. ../common.sh
9get_make
10(cd $PRE; $MAKE streamtcp)
11
12# first test streamtcp against the server unbound.
13echo "> streamtcp -s www.example.com A IN"
14$PRE/streamtcp -s -f 127.0.0.1@$SERV_PORT www.example.com. A IN >outfile 2>outerr
15if test "$?" -ne 0; then
16	echo "exit status not OK"
17	echo "> cat logfiles"
18	cat outfile
19	cat outerr
20	echo "SSLSERVICE"
21	cat unboundserv.log
22	echo "SSLCLIENT"
23	cat unboundclie.log
24	echo "Not OK"
25	exit 1
26else
27	echo "exit status OK"
28fi
29echo "> cat logfiles"
30cat outfile
31cat outerr
32echo "SSLSERVICE"
33cat unboundserv.log
34echo "SSLCLIENT"
35cat unboundclie.log
36echo "> check answer"
37if grep "10.20.30.40" outfile; then
38	echo "OK"
39else
40	echo "Not OK"
41	exit 1
42fi
43
44rm -f outfile
45
46# test client unbound (no SSL towards it, but it does SSL to the SSL service)
47echo "> dig www.example.com A IN"
48dig @127.0.0.1 -p $CLIE_PORT www.example.com. >outfile 2>&1
49if test "$?" -ne 0; then
50	echo "exit status not OK"
51	echo "> cat logfiles"
52	cat outfile
53	echo "SSLSERVICE"
54	cat unboundserv.log
55	echo "SSLCLIENT"
56	cat unboundclie.log
57	echo "Not OK"
58	exit 1
59else
60	echo "exit status OK"
61fi
62echo "> cat logfiles"
63cat outfile
64echo "SSLSERVICE"
65cat unboundserv.log
66echo "SSLCLIENT"
67cat unboundclie.log
68echo "> check answer"
69if grep "10.20.30.40" outfile; then
70	echo "OK"
71else
72	echo "Not OK"
73	exit 1
74fi
75
76exit 0
77