diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-12-12 17:12:21 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-12-12 17:12:21 +0100 |
commit | b02f87bb1c651d42e0477f9459d6919cad294d8c (patch) | |
tree | abf28c31af2df3f246a84b033319ab1e56128ba0 /src/gns | |
parent | 569d3ef34792ed8abc40f3e0ba87db8cac28b76f (diff) | |
download | gnunet-b02f87bb1c651d42e0477f9459d6919cad294d8c.tar.gz gnunet-b02f87bb1c651d42e0477f9459d6919cad294d8c.zip |
fix rest testcase
Diffstat (limited to 'src/gns')
-rwxr-xr-x | src/gns/test_plugin_rest_gns.sh | 12 |
1 files 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 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # This file is in the public domain. | 2 | # This file is in the public domain. |
3 | trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT | 3 | trap "gnunet-arm -e -c test_gns_lookup.conf" INT |
4 | |||
5 | LOCATION=$(which gnunet-config) | 4 | LOCATION=$(which gnunet-config) |
6 | if [ -z $LOCATION ] | 5 | if [ -z $LOCATION ] |
7 | then | 6 | then |
@@ -22,13 +21,16 @@ wrong_link="http://localhost:7776/gnsandmore" | |||
22 | curl_get () { | 21 | curl_get () { |
23 | #$1 is link | 22 | #$1 is link |
24 | #$2 is grep | 23 | #$2 is grep |
25 | cache="$(gnurl -v "$1" 2>&1 | grep "$2")" | 24 | XURL=`which gnurl || which curl` |
25 | echo "Using $XURL to download $1" | ||
26 | cache="$(${XURL} -v "$1" 2>&1 | grep "$2")" | ||
26 | #echo "$cache" | 27 | #echo "$cache" |
27 | if [ "" = "$cache" ] | 28 | if [ "" = "$cache" ] |
28 | then | 29 | then |
29 | gnunet-identity -D "$TEST_TLD" -c test_gns_lookup.conf > /dev/null 2>&1 | 30 | gnunet-identity -D "$TEST_TLD" -c test_gns_lookup.conf > /dev/null 2>&1 |
30 | gnunet-arm -e -c test_gns_lookup.conf | 31 | gnunet-arm -e -c test_gns_lookup.conf |
31 | exit 1 | 32 | echo "HTTP client (curl/gnurl) not found, exiting" |
33 | exit 77 | ||
32 | fi | 34 | fi |
33 | } | 35 | } |
34 | TEST_TLD="testtld" | 36 | TEST_TLD="testtld" |
@@ -64,5 +66,5 @@ gnunet-namestore -z "$TEST_TLD" -d -n www -c test_gns_lookup.conf | |||
64 | gnunet-identity -D "$TEST_TLD" -c test_gns_lookup.conf > /dev/null 2>&1 | 66 | gnunet-identity -D "$TEST_TLD" -c test_gns_lookup.conf > /dev/null 2>&1 |
65 | 67 | ||
66 | curl_get "$gns_link/www1.$TEST_TLD" "error" | 68 | curl_get "$gns_link/www1.$TEST_TLD" "error" |
67 | gnunet-arm -e -c -c test_gns_lookup.conf | 69 | gnunet-arm -e -c test_gns_lookup.conf |
68 | exit 0 | 70 | exit 0 |