aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gns_cname_lookup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/test_gns_cname_lookup.sh')
-rwxr-xr-xsrc/gns/test_gns_cname_lookup.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gns/test_gns_cname_lookup.sh b/src/gns/test_gns_cname_lookup.sh
index de575c561..d97a4fe5e 100755
--- a/src/gns/test_gns_cname_lookup.sh
+++ b/src/gns/test_gns_cname_lookup.sh
@@ -1,4 +1,4 @@
1#!/bin/bash 1#!/bin/sh
2# This file is in the public domain. 2# This file is in the public domain.
3trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT 3trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
4 4
@@ -16,7 +16,7 @@ fi
16 16
17# permissive DNS resolver we will use for the test 17# permissive DNS resolver we will use for the test
18DNS_RESOLVER="8.8.8.8" 18DNS_RESOLVER="8.8.8.8"
19if ! nslookup gnunet.org $DNS_RESOLVER &> /dev/null 19if ! nslookup gnunet.org $DNS_RESOLVER > /dev/null 2>&1
20then 20then
21 echo "Cannot reach DNS, skipping test" 21 echo "Cannot reach DNS, skipping test"
22 exit 77 22 exit 77
@@ -36,7 +36,7 @@ TEST_RECORD_NAME_DNS="www3"
36MY_EGO="myego" 36MY_EGO="myego"
37TEST_DOMAIN_PLUS="www.$MY_EGO" 37TEST_DOMAIN_PLUS="www.$MY_EGO"
38TEST_DOMAIN_DNS="www3.$MY_EGO" 38TEST_DOMAIN_DNS="www3.$MY_EGO"
39which timeout &> /dev/null && DO_TIMEOUT="timeout 15" 39which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 15"
40 40
41gnunet-arm -s -c test_gns_lookup.conf 41gnunet-arm -s -c test_gns_lookup.conf
42gnunet-identity -C $MY_EGO -c test_gns_lookup.conf 42gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
@@ -57,7 +57,7 @@ rm -rf `gnunet-config -c test_gns_lookup.conf -f -s paths -o GNUNET_TEST_HOME`
57# make cmp case-insensitive by converting to lower case first 57# make cmp case-insensitive by converting to lower case first
58RES_CNAME_RAW=`echo $RES_CNAME_RAW | tr [A-Z] [a-z]` 58RES_CNAME_RAW=`echo $RES_CNAME_RAW | tr [A-Z] [a-z]`
59TESTEGOZONE=`echo $TESTEGOZONE | tr [A-Z] [a-z]` 59TESTEGOZONE=`echo $TESTEGOZONE | tr [A-Z] [a-z]`
60if [ "$RES_CNAME_RAW" == "server.$TESTEGOZONE" ] 60if [ "$RES_CNAME_RAW" = "server.$TESTEGOZONE" ]
61then 61then
62 echo "PASS: CNAME resolution from GNS" 62 echo "PASS: CNAME resolution from GNS"
63else 63else
@@ -65,7 +65,7 @@ else
65 exit 1 65 exit 1
66fi 66fi
67 67
68if [ "$RES_CNAME" == "$TEST_IP_PLUS" ] 68if [ "$RES_CNAME" = "$TEST_IP_PLUS" ]
69then 69then
70 echo "PASS: IP resolution from GNS" 70 echo "PASS: IP resolution from GNS"
71else 71else
@@ -73,7 +73,7 @@ else
73 exit 1 73 exit 1
74fi 74fi
75 75
76if [ "$RES_CNAME_DNS" == "$TEST_IP_DNS" ] 76if [ "$RES_CNAME_DNS" = "$TEST_IP_DNS" ]
77then 77then
78 echo "PASS: IP resolution from DNS" 78 echo "PASS: IP resolution from DNS"
79 exit 0 79 exit 0