aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-03-15 13:46:47 +0000
committerng0 <ng0@n0.is>2019-03-15 13:46:47 +0000
commitc0332990f92efcb9569fcb809484f9774eea3a14 (patch)
treeedf425bde1b6b43715175fba8bc50811a22e2510
parent29953dcd965d8b2a6fe2e0d9220bc0066005ffa5 (diff)
downloadgnunet-c0332990f92efcb9569fcb809484f9774eea3a14.tar.gz
gnunet-c0332990f92efcb9569fcb809484f9774eea3a14.zip
test_gnunet_gns: Fix test
-rwxr-xr-xsrc/gns/test_gnunet_gns.sh22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gns/test_gnunet_gns.sh b/src/gns/test_gnunet_gns.sh
index 7e0b4b5c5..74c49c537 100755
--- a/src/gns/test_gnunet_gns.sh
+++ b/src/gns/test_gnunet_gns.sh
@@ -1,15 +1,25 @@
1#!/bin/sh 1#!/bin/sh
2# This file is in the public domain. 2# This file is in the public domain.
3LOCATION=$(which gnunet-config) 3# test -z being correct was a false assumption here.
4if [ -z $LOCATION ] 4# I have no executable 'fooble', but this will
5then 5# return 1:
6 LOCATION="gnunet-config" 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.
9existence()
10{
11 command -v "$1" >/dev/null 2>&1
12}
13
14LOCATION=`existence gnunet-config`
15if test -z $LOCATION; then
16 LOCATION="gnunet-config"
7fi 17fi
8$LOCATION --version 18$LOCATION --version
9if test $? != 0 19if test $? != 0
10then 20then
11 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" 21 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
12 exit 77 22 exit 77
13fi 23fi
14 24
15trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT 25trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT