1 # #-- 08-host-lib.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 if grep FORK $PRE/config.h | grep "define" >/dev/null 2>&1; then
14 echo "forking is not available; test skipped."
19 echo "> dig @127.0.0.1 -p $FWD_PORT www.example.com | tee outfile"
20 dig @127.0.0.1 -p $FWD_PORT www.example.com | tee outfile
21 if grep "10.20.30.40" outfile; then
32 echo "> (cd $PRE ; $MAKE asynclook)"
33 (cd $PRE ; $MAKE asynclook)
34 if test ! -x $PRE/asynclook; then
35 echo "cannot build asynclook test program"
38 (cd $PRE ; $MAKE lock-verify)
42 if test -x $PRE/lock-verify -a -f ublocktrace.0; then
43 $PRE/lock-verify ublocktrace.*
44 if test $? -ne 0; then
45 echo "lock-verify error"
51 # test hosts reading (directed at local auth info)
52 echo '> $PRE/asynclook -H 08-host-lib.hosts virtual.virtual.virtual.local 2>&1 | tee outfile'
53 $PRE/asynclook -H 08-host-lib.hosts virtual.virtual.virtual.local 2>&1 | tee outfile
54 if grep "virtual.virtual.virtual.local: 10.20.30.40" outfile; then
63 # test async lookups (directed at testns)
64 echo '> $PRE/asynclook -f "127.0.0.1@"$FWD_PORT www.example.com 2>&1 | tee outfile'
65 $PRE/asynclook -f "127.0.0.1@"$FWD_PORT www.example.com 2>&1 | tee outfile
66 if grep "www.example.com: 10.20.30.40" outfile; then
76 echo '> $PRE/asynclook -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile'
77 $PRE/asynclook -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile
78 if grep "www.example.com: 10.20.30.40" outfile; then
85 if grep "www2.example.com: 10.20.30.42" outfile; then
95 echo '> $PRE/asynclook -t -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile'
96 $PRE/asynclook -t -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile
97 if grep "www.example.com: 10.20.30.40" outfile; then
104 if grep "www2.example.com: 10.20.30.42" outfile; then
115 echo '> $PRE/asynclook -c -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile'
116 $PRE/asynclook -c -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile
117 if grep "www.example.com: cancelled" outfile; then
124 if grep "www2.example.com: cancelled" outfile; then
134 echo '> $PRE/asynclook -t -c -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile'
135 $PRE/asynclook -t -c -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile
136 if grep "www.example.com: cancelled" outfile; then
143 if grep "www2.example.com: cancelled" outfile; then
154 echo '> $PRE/asynclook -b -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile'
155 $PRE/asynclook -b -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile
156 if grep "www.example.com: 10.20.30.40" outfile; then
163 if grep "www2.example.com: 10.20.30.42" outfile; then
173 echo '> $PRE/asynclook -t -b -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile'
174 $PRE/asynclook -t -b -f "127.0.0.1@"$FWD_PORT www.example.com www2.example.com 2>&1 | tee outfile
175 if grep "www.example.com: 10.20.30.40" outfile; then
182 if grep "www2.example.com: 10.20.30.42" outfile; then
192 echo "> cat logfiles"