aboutsummaryrefslogtreecommitdiff
path: root/src/dns
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-17 22:25:52 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-17 22:25:52 +0000
commit9bce094f751c1e80a41c4ea509845205e8842845 (patch)
tree4a02e422c981ed9911f599c4bebc11b62c773de2 /src/dns
parent11cbed2558f43f11a4329266ecfb46bf916c5a4a (diff)
downloadgnunet-9bce094f751c1e80a41c4ea509845205e8842845.tar.gz
gnunet-9bce094f751c1e80a41c4ea509845205e8842845.zip
-adding testcase
Diffstat (limited to 'src/dns')
-rw-r--r--src/dns/Makefile.am8
-rwxr-xr-xsrc/dns/test_gnunet_dns.sh18
2 files changed, 26 insertions, 0 deletions
diff --git a/src/dns/Makefile.am b/src/dns/Makefile.am
index 5f9f39116..d8c2cd1c1 100644
--- a/src/dns/Makefile.am
+++ b/src/dns/Makefile.am
@@ -40,6 +40,9 @@ noinst_PROGRAMS = \
40plugin_LTLIBRARIES = \ 40plugin_LTLIBRARIES = \
41 libgnunet_plugin_block_dns.la 41 libgnunet_plugin_block_dns.la
42 42
43check_SCRIPTS = \
44 test_gnunet_dns.sh
45
43 46
44gnunet_helper_dns_SOURCES = \ 47gnunet_helper_dns_SOURCES = \
45 gnunet-helper-dns.c 48 gnunet-helper-dns.c
@@ -97,4 +100,9 @@ libgnunet_plugin_block_dns_la_LDFLAGS = \
97 $(top_builddir)/src/block/$(GN_PLUGIN_LDFLAGS) 100 $(top_builddir)/src/block/$(GN_PLUGIN_LDFLAGS)
98 101
99 102
103if ENABLE_TEST_RUN
104TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
105endif
100 106
107EXTRA_DIST = \
108 $(check_SCRIPTS)
diff --git a/src/dns/test_gnunet_dns.sh b/src/dns/test_gnunet_dns.sh
new file mode 100755
index 000000000..35585d46e
--- /dev/null
+++ b/src/dns/test_gnunet_dns.sh
@@ -0,0 +1,18 @@
1#!/bin/bash
2
3ME=`whoami`
4if [ "$ME" != "root" ]
5then
6 echo "This test only works if run as root. Skipping."
7 exit 0
8fi
9export PATH=".:$PATH"
10gnunet-service-dns -c dns.conf &
11gnunet-dns-redirector -c dns.conf -4 127.0.0.1 &
12sleep 1
13LO=`nslookup gnunet.org | grep Address | tail -n1`
14if [ "$LO" != "Address: 127.0.0.1" ]
15then
16 echo "Fail: $LO"
17fi
18kill `jobs -p`