| 1 |
# #-- fwd_ttlexpire.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 |
|
| 7 |
PRE="../.." |
| 8 |
# do the test |
| 9 |
echo "> dig www.example.com." |
| 10 |
dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile |
| 11 |
echo "> check answer" |
| 12 |
if grep "10.20.30.40" outfile; then |
| 13 |
echo "OK" |
| 14 |
else |
| 15 |
echo "Not OK" |
| 16 |
exit 1 |
| 17 |
fi |
| 18 |
# wait for query to expire. |
| 19 |
sleep 4 |
| 20 |
# query again |
| 21 |
rm outfile |
| 22 |
echo "> dig www.example.com." |
| 23 |
dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile |
| 24 |
echo "> check answer" |
| 25 |
if grep "10.20.30.40" outfile; then |
| 26 |
echo "OK" |
| 27 |
else |
| 28 |
echo "Not OK" |
| 29 |
exit 1 |
| 30 |
fi |
| 31 |
echo "> cat logfiles" |
| 32 |
cat fwd.log |
| 33 |
cat unbound.log |
| 34 |
|
| 35 |
exit 0 |