-revocation
authorMartin Schanzenbach <mschanzenbach@posteo.de>
Sun, 20 Oct 2013 13:33:21 +0000 (13:33 +0000)
committerMartin Schanzenbach <mschanzenbach@posteo.de>
Sun, 20 Oct 2013 13:33:21 +0000 (13:33 +0000)
src/gns/Makefile.am
src/gns/test_gns_lookup.conf
src/gns/test_gns_ns_lookup.sh
src/gns/test_gns_revocation.sh [new file with mode: 0755]

index b0cc6a0eb11db45e9292bb889fc7f42a02528f45..d2dc3179e5dbf7556849b5487f3286c02abc8280 100644 (file)
@@ -227,6 +227,8 @@ check_SCRIPTS = \
   test_gns_plus_lookup.sh\
   test_gns_zkey_lookup.sh\
   test_gns_rel_expiration.sh\
+       test_gns_soa_lookup.sh\
+       test_gns_revocation.sh\
   test_gns_cname_lookup.sh
 
 if ENABLE_TEST_RUN
index 89007c2790e50b1540fb1720f49517eb7e624da6..c4be10eb8b88edd4b04723b0215cca0294961758 100644 (file)
@@ -20,3 +20,6 @@ DEFAULT_LOOKUP_TIMEOUT = 15 s
 RECORD_PUT_INTERVAL = 1 h
 ZONE_PUBLISH_TIME_WINDOW = 1 h
 DNS_ROOT=6KT43HD94T0C7R43JSE1U5G982BOHT9RCENEV7HT1207APDBQIT5RLLK2LCSC0PL2ICNRFPPQ834TIVOKK421TP1T1NNUKG43OHKPV8
+
+[revocation]
+WORKBITS = 1
index 8c77a54c62b9a8b49f1817d69185e9e9f0b08651..878d2aad4ab5497b8ab53e191da1ec9eed049c4f 100755 (executable)
@@ -6,6 +6,7 @@ TEST_DOMAIN_ALT="homepage.gnu"
 TEST_DOMAIN_ALT2="uk.homepage.gnu"
 TEST_IP_ALT2="81.187.252.184"
 TEST_IP="131.159.74.67"
+TEST_IP6="2001:4ca0:2001:42:225:90ff:fe6b:d60"
 TEST_IP_GNS2DNS="184.172.157.218"
 TEST_RECORD_NAME="homepage"
 TEST_RECORD_GNS2DNS="gnunet.org"
@@ -14,6 +15,7 @@ gnunet-identity -C testego -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME -t A -V $TEST_IP_GNS2DNS -e never -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME -t GNS2DNS -V $TEST_RECORD_GNS2DNS -e never -c test_gns_lookup.conf
 RES_IP=$(timeout 5 gnunet-gns --raw -z testego -u $TEST_DOMAIN -t A -c test_gns_lookup.conf)
+RES_IP6=$(timeout 5 gnunet-gns --raw -z testego -u $TEST_DOMAIN -t AAAA -c test_gns_lookup.conf)
 RES_IP_ALT=$(timeout 5 gnunet-gns --raw -z testego -u $TEST_DOMAIN_ALT -t A -c test_gns_lookup.conf)
 RES_IP_ALT2=$(timeout 5 gnunet-gns --raw -z testego -u $TEST_DOMAIN_ALT2 -t A -c test_gns_lookup.conf)
 gnunet-namestore -z testego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
@@ -29,6 +31,14 @@ else
   exit 1
 fi
 
+if [ "$RES_IP6" == "$TEST_IP6" ]
+then
+  echo "PASS: Resolved $TEST_DOMAIN to $RES_IP6."
+else
+  echo "Failed to resolve to proper IP for $TEST_DOMAIN, got $RES_IP6, wanted $TEST_IP6."
+  exit 1
+fi
+
 if [ "$RES_IP_ALT" == "$TEST_IP" ]
 then
   echo "PASS: Resolved $TEST_DOMAIN_ALT to $RES_IP_ALT."
diff --git a/src/gns/test_gns_revocation.sh b/src/gns/test_gns_revocation.sh
new file mode 100755 (executable)
index 0000000..5c28407
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
+which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
+rm -rf `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f`
+
+TEST_IP="127.0.0.1"
+gnunet-arm -s -c test_gns_lookup.conf
+gnunet-identity -C delegatedego -c test_gns_lookup.conf
+DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep delegatedego | awk '{print $3}')
+gnunet-identity -C testego -c test_gns_lookup.conf
+gnunet-namestore -p -z testego -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
+gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
+RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf`
+gnunet-revocation -R delegatedego -p  -c test_gns_lookup.conf
+RES_IP_REV=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf`
+gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY  -e never -c test_gns_lookup.conf
+gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP  -e never -c test_gns_lookup.conf
+gnunet-arm -e -c test_gns_lookup.conf
+
+if [ "$RES_IP" != "$TEST_IP" ]
+then
+  echo "Failed to resolve to proper IP, got $RES_IP."
+  exit 1
+fi
+
+if [ "$RES_IP_REV" == " " ]
+then
+  exit 0
+else
+  echo "Failed to revoke zone, got $RES_IP."
+  exit 1
+fi