From b02f87bb1c651d42e0477f9459d6919cad294d8c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 12 Dec 2019 17:12:21 +0100 Subject: [PATCH] fix rest testcase --- src/gns/test_plugin_rest_gns.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gns/test_plugin_rest_gns.sh b/src/gns/test_plugin_rest_gns.sh index 4079b8bad..1412f8753 100755 --- a/src/gns/test_plugin_rest_gns.sh +++ b/src/gns/test_plugin_rest_gns.sh @@ -1,7 +1,6 @@ #!/bin/sh # This file is in the public domain. -trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT - +trap "gnunet-arm -e -c test_gns_lookup.conf" INT LOCATION=$(which gnunet-config) if [ -z $LOCATION ] then @@ -22,13 +21,16 @@ wrong_link="http://localhost:7776/gnsandmore" curl_get () { #$1 is link #$2 is grep - cache="$(gnurl -v "$1" 2>&1 | grep "$2")" + XURL=`which gnurl || which curl` + echo "Using $XURL to download $1" + cache="$(${XURL} -v "$1" 2>&1 | grep "$2")" #echo "$cache" if [ "" = "$cache" ] then gnunet-identity -D "$TEST_TLD" -c test_gns_lookup.conf > /dev/null 2>&1 gnunet-arm -e -c test_gns_lookup.conf - exit 1 + echo "HTTP client (curl/gnurl) not found, exiting" + exit 77 fi } TEST_TLD="testtld" @@ -64,5 +66,5 @@ gnunet-namestore -z "$TEST_TLD" -d -n www -c test_gns_lookup.conf gnunet-identity -D "$TEST_TLD" -c test_gns_lookup.conf > /dev/null 2>&1 curl_get "$gns_link/www1.$TEST_TLD" "error" -gnunet-arm -e -c -c test_gns_lookup.conf +gnunet-arm -e -c test_gns_lookup.conf exit 0 -- 2.25.1