xref: /netbsd-src/external/bsd/unbound/dist/testdata/pylib.tdir/pylib.test (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1# #-- pylib.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="../.."
8if grep "define WITH_PYUNBOUND 1" $PRE/config.h; then
9	echo "have python module"
10else
11	echo "no python module"
12	exit 0
13fi
14
15if test "`uname 2>&1`" = "Darwin"; then
16	echo export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:../../.libs"
17	export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:../../.libs"
18fi
19#echo export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:../../.libs:."
20#export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:../../.libs:."
21
22cp $PRE/libunbound/python/unbound.py .
23cp $PRE/.libs/_unbound* .
24cp $PRE/.libs/libunbound* .
25
26# do the test
27echo "> pylib.lookup.py www.example.com."
28./pylib.lookup.py www.example.com. | tee outfile
29
30echo "> cat logfiles"
31cat fwd.log
32echo "> check answer"
33if grep "10.20.30.40" outfile; then
34	echo "OK"
35else
36	echo "Not OK"
37	exit 1
38fi
39
40exit 0
41