aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gnunet_gns.sh.in
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-11-25 22:13:05 +0000
committerng0 <ng0@n0.is>2019-11-25 22:13:05 +0000
commit861eba2bab4465ffc3dc5e6309e89519594f0ea1 (patch)
treead7a82c9848e2bf92f90ff3842abee40daee1fad /src/gns/test_gnunet_gns.sh.in
parent868ad5f875f8e7b271d20b77c7ef47ec53fe187c (diff)
downloadgnunet-861eba2bab4465ffc3dc5e6309e89519594f0ea1.tar.gz
gnunet-861eba2bab4465ffc3dc5e6309e89519594f0ea1.zip
test_gnunet_gns.sh: use shlib
Diffstat (limited to 'src/gns/test_gnunet_gns.sh.in')
-rwxr-xr-xsrc/gns/test_gnunet_gns.sh.in43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/gns/test_gnunet_gns.sh.in b/src/gns/test_gnunet_gns.sh.in
new file mode 100755
index 000000000..1c149b141
--- /dev/null
+++ b/src/gns/test_gnunet_gns.sh.in
@@ -0,0 +1,43 @@
1#!/bin/sh
2# This file is in the public domain.
3# test -z being correct was a false assumption here.
4# I have no executable 'fooble', but this will
5# return 1:
6# if test -z "`which fooble`"; then echo 1; fi
7# The command builtin might not work with busybox's ash
8# but this works for now.
9. @pkgdatadir@/existence.sh
10
11LOCATION=`existence gnunet-config`
12if test -z $LOCATION; then
13 LOCATION="gnunet-config"
14fi
15$LOCATION --version
16if test $? != 0
17then
18 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
19 exit 77
20fi
21
22trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
23ME=`whoami`
24if [ "$ME" != "root" ]
25then
26 echo "This test only works if run as root. Skipping."
27 exit 77
28fi
29export PATH=".:$PATH"
30gnunet-service-gns -c gns.conf &
31sleep 1
32LO=`nslookup alice.gnu | grep Address | tail -n1`
33if [ "$LO" != "Address: 1.2.3.4" ]
34then
35 echo "Fail: $LO"
36fi
37LO=`nslookup www.bob.gnu | grep Address | tail -n1`
38if [ "$LO" != "Address: 4.5.6.7" ]
39then
40 echo "Fail: $LO"
41fi
42# XXX: jobs. a builtin by bash, netbsd sh, maybe leave it be for now.
43kill `jobs -p`