X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fgns%2Ftest_gnunet_gns.sh;h=f6b4e721ab52ca8edadfcbc520f5b50b82dff709;hb=4f5d89e5f6b43017a94cc1d3a9f15ca4094aa2dc;hp=cd680276d2f8aaea3e7c1868903129365e76b38b;hpb=0c7a03ffdb1388ac0caf90a22f9b1e93b6befa8f;p=oweals%2Fgnunet.git diff --git a/src/gns/test_gnunet_gns.sh b/src/gns/test_gnunet_gns.sh index cd680276d..f6b4e721a 100755 --- a/src/gns/test_gnunet_gns.sh +++ b/src/gns/test_gnunet_gns.sh @@ -1,20 +1,33 @@ #!/bin/bash +# This file is in the public domain. +LOCATION=$(which gnunet-config) +if [ -z $LOCATION ] +then + LOCATION="gnunet-config" +fi +$LOCATION --version +if test $? != 0 +then + echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" + exit 77 +fi +trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT ME=`whoami` if [ "$ME" != "root" ] then echo "This test only works if run as root. Skipping." - exit 0 + exit 77 fi export PATH=".:$PATH" gnunet-service-gns -c gns.conf & sleep 1 -LO=`nslookup alice.gnunet | grep Address | tail -n1` +LO=`nslookup alice.gnu | grep Address | tail -n1` if [ "$LO" != "Address: 1.2.3.4" ] then echo "Fail: $LO" fi -LO=`nslookup www.bob.gnunet | grep Address | tail -n1` +LO=`nslookup www.bob.gnu | grep Address | tail -n1` if [ "$LO" != "Address: 4.5.6.7" ] then echo "Fail: $LO"