summaryrefslogtreecommitdiff
path: root/testdata/pymod.tdir/pymod.test
diff options
context:
space:
mode:
Diffstat (limited to 'testdata/pymod.tdir/pymod.test')
-rw-r--r--testdata/pymod.tdir/pymod.test56
1 files changed, 56 insertions, 0 deletions
diff --git a/testdata/pymod.tdir/pymod.test b/testdata/pymod.tdir/pymod.test
new file mode 100644
index 000000000000..43bf6e65f87f
--- /dev/null
+++ b/testdata/pymod.tdir/pymod.test
@@ -0,0 +1,56 @@
+# #-- pymod.test --#
+# source the master var file when it's there
+[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
+# use .tpkg.var.test for in test variable passing
+[ -f .tpkg.var.test ] && source .tpkg.var.test
+
+PRE="../.."
+if grep "define WITH_PYTHONMODULE 1" $PRE/config.h; then
+ echo "have python module"
+else
+ echo "no python module"
+ exit 0
+fi
+
+if test "`uname 2>&1`" = "Darwin"; then
+ ldnsdir=`grep ldnsdir= ../../Makefile | sed -e 's/ldnsdir=//'`
+ echo export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$ldnsdir/lib:../../.libs"
+ export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$ldnsdir/lib:../../.libs"
+fi
+
+# see if config file verifies
+if $PRE/unbound-checkconf ub.conf; then
+ echo "checkconf OK"
+else
+ echo "checkconf failed"
+ exit 1
+fi
+
+# do the test
+echo "> dig www.example.com."
+dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+echo "> cat logfiles"
+cat fwd.log
+cat unbound.log
+echo "> check answer"
+if grep "10.20.30.40" outfile; then
+ echo "OK"
+else
+ echo "Not OK"
+ exit 1
+fi
+
+echo "> dig www2.example.com."
+dig @localhost -p $UNBOUND_PORT www2.example.com. | tee outfile
+echo "> cat logfiles"
+cat fwd.log
+cat unbound.log
+echo "> check answer"
+if grep "192.168.1.1" outfile; then
+ echo "OK"
+else
+ echo "Not OK"
+ exit 1
+fi
+
+exit 0