diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-11-12 21:25:06 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-11-12 21:25:06 +0100 |
commit | 98288a7b26344294a3668101b9c2b502dfc19e12 (patch) | |
tree | 2e866ba37df840668bfe5984e5fefcf05528066e /src | |
parent | 5db18738ebf3c284d4bc0d7080e542e5ab1c7462 (diff) | |
download | gnunet-98288a7b26344294a3668101b9c2b502dfc19e12.tar.gz gnunet-98288a7b26344294a3668101b9c2b502dfc19e12.zip |
add logic to skip tests if DNS or /etc/hosts does not like us
Diffstat (limited to 'src')
-rwxr-xr-x | src/gns/test_gns_gns2dns_cname_lookup.sh | 9 | ||||
-rwxr-xr-x | src/gns/test_gns_gns2dns_lookup.sh | 10 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/gns/test_gns_gns2dns_cname_lookup.sh b/src/gns/test_gns_gns2dns_cname_lookup.sh index 84ad8549f..17196f820 100755 --- a/src/gns/test_gns_gns2dns_cname_lookup.sh +++ b/src/gns/test_gns_gns2dns_cname_lookup.sh | |||
@@ -43,7 +43,15 @@ MY_EGO="myego" | |||
43 | # various names we will use for resolution | 43 | # various names we will use for resolution |
44 | TEST_DOMAIN="www.${TEST_RECORD_NAME}.$MY_EGO" | 44 | TEST_DOMAIN="www.${TEST_RECORD_NAME}.$MY_EGO" |
45 | 45 | ||
46 | which timeout &> /dev/null && DO_TIMEOUT="timeout 15" | ||
47 | |||
48 | |||
46 | gnunet-arm -s -c test_gns_lookup.conf | 49 | gnunet-arm -s -c test_gns_lookup.conf |
50 | |||
51 | echo $OUT | grep $TEST_IP - > /dev/null || { gnunet-arm -e -c test_gns_lookup.conf ; echo "IPv4 for gnunet.org not found, skipping test"; exit 77; } | ||
52 | echo $OUT | grep $TEST6_IP - > /dev/null || { gnunet-arm -e -c test_gns_lookup.conf ; echo "IPv6 for gnunet.org not found, skipping test"; exit 77; } | ||
53 | |||
54 | |||
47 | gnunet-identity -C $MY_EGO -c test_gns_lookup.conf | 55 | gnunet-identity -C $MY_EGO -c test_gns_lookup.conf |
48 | 56 | ||
49 | # set IP address for DNS resolver for resolving in gnunet.org domain | 57 | # set IP address for DNS resolver for resolving in gnunet.org domain |
@@ -52,7 +60,6 @@ gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t GNS2DNS -V $TEST_RECOR | |||
52 | gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t GNS2DNS -V $TEST_RECORD_GNS2DNS2 -e never -c test_gns_lookup.conf | 60 | gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t GNS2DNS -V $TEST_RECORD_GNS2DNS2 -e never -c test_gns_lookup.conf |
53 | gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t GNS2DNS -V $TEST_RECORD_GNS2DNS3 -e never -c test_gns_lookup.conf | 61 | gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t GNS2DNS -V $TEST_RECORD_GNS2DNS3 -e never -c test_gns_lookup.conf |
54 | 62 | ||
55 | which timeout &> /dev/null && DO_TIMEOUT="timeout 15" | ||
56 | 63 | ||
57 | echo "EGOs:" | 64 | echo "EGOs:" |
58 | gnunet-identity -d | 65 | gnunet-identity -d |
diff --git a/src/gns/test_gns_gns2dns_lookup.sh b/src/gns/test_gns_gns2dns_lookup.sh index 122e45525..431f01086 100755 --- a/src/gns/test_gns_gns2dns_lookup.sh +++ b/src/gns/test_gns_gns2dns_lookup.sh | |||
@@ -44,8 +44,17 @@ TEST_DOMAIN="www.${TEST_RECORD_NAME}.$MY_EGO" | |||
44 | TEST_DOMAIN_ALT="${TEST_RECORD_NAME}.$MY_EGO" | 44 | TEST_DOMAIN_ALT="${TEST_RECORD_NAME}.$MY_EGO" |
45 | TEST_DOMAIN_ALT2="docs.${TEST_RECORD_NAME}.$MY_EGO" | 45 | TEST_DOMAIN_ALT2="docs.${TEST_RECORD_NAME}.$MY_EGO" |
46 | 46 | ||
47 | which timeout &> /dev/null && DO_TIMEOUT="timeout 15" | ||
48 | |||
47 | 49 | ||
48 | gnunet-arm -s -c test_gns_lookup.conf | 50 | gnunet-arm -s -c test_gns_lookup.conf |
51 | |||
52 | OUT=`$DO_TIMEOUT gnunet-resolver -c test_gns_lookup.conf gnunet.org` | ||
53 | echo $OUT | grep $TEST_IP - > /dev/null || { gnunet-arm -e -c test_gns_lookup.conf ; echo "IPv4 for gnunet.org not found, skipping test"; exit 77; } | ||
54 | echo $OUT | grep $TEST6_IP - > /dev/null || { gnunet-arm -e -c test_gns_lookup.conf ; echo "IPv6 for gnunet.org not found, skipping test"; exit 77; } | ||
55 | |||
56 | |||
57 | |||
49 | gnunet-identity -C $MY_EGO -c test_gns_lookup.conf | 58 | gnunet-identity -C $MY_EGO -c test_gns_lookup.conf |
50 | 59 | ||
51 | # set IP address for DNS resolver for resolving in gnunet.org domain | 60 | # set IP address for DNS resolver for resolving in gnunet.org domain |
@@ -53,7 +62,6 @@ gnunet-namestore -p -z $MY_EGO -a -n $TEST_RESOLVER_LABEL -t A -V $TEST_IP_GNS2D | |||
53 | # map '$TEST_RECORD_NAME.$MY_EGO' to 'gnunet.org' in DNS | 62 | # map '$TEST_RECORD_NAME.$MY_EGO' to 'gnunet.org' in DNS |
54 | gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t GNS2DNS -V $TEST_RECORD_GNS2DNS -e never -c test_gns_lookup.conf | 63 | gnunet-namestore -p -z $MY_EGO -a -n $TEST_RECORD_NAME -t GNS2DNS -V $TEST_RECORD_GNS2DNS -e never -c test_gns_lookup.conf |
55 | 64 | ||
56 | which timeout &> /dev/null && DO_TIMEOUT="timeout 15" | ||
57 | 65 | ||
58 | echo "EGOs:" | 66 | echo "EGOs:" |
59 | gnunet-identity -d | 67 | gnunet-identity -d |