diff options
-rwxr-xr-x | src/gns/test_gns_cname_lookup.sh | 9 | ||||
-rwxr-xr-x | src/gns/test_gns_lookup.sh | 15 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/gns/test_gns_cname_lookup.sh b/src/gns/test_gns_cname_lookup.sh index 1b91701cc..45146a863 100755 --- a/src/gns/test_gns_cname_lookup.sh +++ b/src/gns/test_gns_cname_lookup.sh | |||
@@ -19,6 +19,7 @@ gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t CNAME -V $TEST_REC | |||
19 | gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RECORD_CNAME_PLUS -e never -c test_gns_lookup.conf | 19 | gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RECORD_CNAME_PLUS -e never -c test_gns_lookup.conf |
20 | gnunet-namestore -p -z testego -a -n $TEST_RECORD_CNAME_SERVER -t A -V $TEST_IP_PLUS -e never -c test_gns_lookup.conf | 20 | gnunet-namestore -p -z testego -a -n $TEST_RECORD_CNAME_SERVER -t A -V $TEST_IP_PLUS -e never -c test_gns_lookup.conf |
21 | RES_CNAME=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf` | 21 | RES_CNAME=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf` |
22 | RES_CNAME_RAW=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t CNAME -c test_gns_lookup.conf` | ||
22 | RES_CNAME_DNS=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www3.gnu -t A -c test_gns_lookup.conf` | 23 | RES_CNAME_DNS=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www3.gnu -t A -c test_gns_lookup.conf` |
23 | gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t CNAME -V $TEST_RECORD_CNAME_DNS -e never -c test_gns_lookup.conf | 24 | gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t CNAME -V $TEST_RECORD_CNAME_DNS -e never -c test_gns_lookup.conf |
24 | gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RECORD_CNAME_PLUS -e never -c test_gns_lookup.conf | 25 | gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RECORD_CNAME_PLUS -e never -c test_gns_lookup.conf |
@@ -26,6 +27,14 @@ gnunet-namestore -p -z testego -d -n $TEST_RECORD_CNAME_SERVER -t A -V $TEST_IP_ | |||
26 | gnunet-identity -D testego -c test_gns_lookup.conf | 27 | gnunet-identity -D testego -c test_gns_lookup.conf |
27 | gnunet-arm -e -c test_gns_lookup.conf | 28 | gnunet-arm -e -c test_gns_lookup.conf |
28 | 29 | ||
30 | if [ "$RES_CNAME_RAW" == "server.gnu" ] | ||
31 | then | ||
32 | echo "PASS: CNAME resulution from GNS" | ||
33 | else | ||
34 | echo "FAIL: CNAME resolution from GNS, got $RES_CNAME_RAW." | ||
35 | exit 1 | ||
36 | fi | ||
37 | |||
29 | if [ "$RES_CNAME" == "$TEST_IP_PLUS" ] | 38 | if [ "$RES_CNAME" == "$TEST_IP_PLUS" ] |
30 | then | 39 | then |
31 | echo "PASS: IP resulution from GNS" | 40 | echo "PASS: IP resulution from GNS" |
diff --git a/src/gns/test_gns_lookup.sh b/src/gns/test_gns_lookup.sh index 11daee7e4..85cc1f511 100755 --- a/src/gns/test_gns_lookup.sh +++ b/src/gns/test_gns_lookup.sh | |||
@@ -3,18 +3,31 @@ trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT | |||
3 | rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f` | 3 | rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f` |
4 | which timeout &> /dev/null && DO_TIMEOUT="timeout 5" | 4 | which timeout &> /dev/null && DO_TIMEOUT="timeout 5" |
5 | TEST_IP="127.0.0.1" | 5 | TEST_IP="127.0.0.1" |
6 | TEST_IP6="dead::beef" | ||
6 | gnunet-arm -s -c test_gns_lookup.conf | 7 | gnunet-arm -s -c test_gns_lookup.conf |
7 | gnunet-identity -C testego -c test_gns_lookup.conf | 8 | gnunet-identity -C testego -c test_gns_lookup.conf |
8 | gnunet-namestore -p -z testego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf | 9 | gnunet-namestore -p -z testego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf |
10 | gnunet-namestore -p -z testego -a -n www -t AAAA -V $TEST_IP6 -e never -c test_gns_lookup.conf | ||
9 | RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf` | 11 | RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf` |
12 | RES_IP6=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t AAAA -c test_gns_lookup.conf` | ||
10 | gnunet-namestore -z testego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf | 13 | gnunet-namestore -z testego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf |
14 | gnunet-namestore -z testego -d -n www -t AAAA -V $TEST_IP6 -e never -c test_gns_lookup.conf | ||
11 | gnunet-identity -D testego -c test_gns_lookup.conf | 15 | gnunet-identity -D testego -c test_gns_lookup.conf |
12 | gnunet-arm -e -c test_gns_lookup.conf | 16 | gnunet-arm -e -c test_gns_lookup.conf |
13 | 17 | ||
18 | if [ "$RES_IP6" == "$TEST_IP6" ] | ||
19 | then | ||
20 | echo "PASS: Resolved correct IPv6 address, got $RES_IP6" | ||
21 | else | ||
22 | echo "FAIL: Failed to resolve to proper IP, got $RES_IP6." | ||
23 | exit 1 | ||
24 | fi | ||
25 | |||
14 | if [ "$RES_IP" == "$TEST_IP" ] | 26 | if [ "$RES_IP" == "$TEST_IP" ] |
15 | then | 27 | then |
28 | echo "PASS: Resolved correct IP address, got $RES_IP" | ||
16 | exit 0 | 29 | exit 0 |
17 | else | 30 | else |
18 | echo "Failed to resolve to proper IP, got $RES_IP." | 31 | echo "FAIL: Failed to resolve to proper IP, got $RES_IP." |
19 | exit 1 | 32 | exit 1 |
20 | fi | 33 | fi |