diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-17 22:25:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-17 22:25:52 +0000 |
commit | 9bce094f751c1e80a41c4ea509845205e8842845 (patch) | |
tree | 4a02e422c981ed9911f599c4bebc11b62c773de2 /src/dns | |
parent | 11cbed2558f43f11a4329266ecfb46bf916c5a4a (diff) | |
download | gnunet-9bce094f751c1e80a41c4ea509845205e8842845.tar.gz gnunet-9bce094f751c1e80a41c4ea509845205e8842845.zip |
-adding testcase
Diffstat (limited to 'src/dns')
-rw-r--r-- | src/dns/Makefile.am | 8 | ||||
-rwxr-xr-x | src/dns/test_gnunet_dns.sh | 18 |
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 = \ | |||
40 | plugin_LTLIBRARIES = \ | 40 | plugin_LTLIBRARIES = \ |
41 | libgnunet_plugin_block_dns.la | 41 | libgnunet_plugin_block_dns.la |
42 | 42 | ||
43 | check_SCRIPTS = \ | ||
44 | test_gnunet_dns.sh | ||
45 | |||
43 | 46 | ||
44 | gnunet_helper_dns_SOURCES = \ | 47 | gnunet_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 | ||
103 | if ENABLE_TEST_RUN | ||
104 | TESTS = $(check_PROGRAMS) $(check_SCRIPTS) | ||
105 | endif | ||
100 | 106 | ||
107 | EXTRA_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 | |||
3 | ME=`whoami` | ||
4 | if [ "$ME" != "root" ] | ||
5 | then | ||
6 | echo "This test only works if run as root. Skipping." | ||
7 | exit 0 | ||
8 | fi | ||
9 | export PATH=".:$PATH" | ||
10 | gnunet-service-dns -c dns.conf & | ||
11 | gnunet-dns-redirector -c dns.conf -4 127.0.0.1 & | ||
12 | sleep 1 | ||
13 | LO=`nslookup gnunet.org | grep Address | tail -n1` | ||
14 | if [ "$LO" != "Address: 127.0.0.1" ] | ||
15 | then | ||
16 | echo "Fail: $LO" | ||
17 | fi | ||
18 | kill `jobs -p` | ||