From: Martin Schanzenbach Date: Sun, 20 Oct 2013 13:33:21 +0000 (+0000) Subject: -revocation X-Git-Tag: initial-import-from-subversion-38251~6395 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=11cd4959d673c5c58d9a952d25425c3ca4ba4b3e;p=oweals%2Fgnunet.git -revocation --- diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am index b0cc6a0eb..d2dc3179e 100644 --- a/src/gns/Makefile.am +++ b/src/gns/Makefile.am @@ -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 diff --git a/src/gns/test_gns_lookup.conf b/src/gns/test_gns_lookup.conf index 89007c279..c4be10eb8 100644 --- a/src/gns/test_gns_lookup.conf +++ b/src/gns/test_gns_lookup.conf @@ -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 diff --git a/src/gns/test_gns_ns_lookup.sh b/src/gns/test_gns_ns_lookup.sh index 8c77a54c6..878d2aad4 100755 --- a/src/gns/test_gns_ns_lookup.sh +++ b/src/gns/test_gns_ns_lookup.sh @@ -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 index 000000000..5c2840798 --- /dev/null +++ b/src/gns/test_gns_revocation.sh @@ -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