From 76ce26ad071dab7e058b8c8b83647b7fa544ad27 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 17 Oct 2013 22:58:21 +0000 Subject: expiration test --- src/gns/Makefile.am | 1 + src/gns/test_gns_lookup.conf | 1 + src/gns/test_gns_rel_expiration.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100755 src/gns/test_gns_rel_expiration.sh diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am index da6da331e..3182c3f7e 100644 --- a/src/gns/Makefile.am +++ b/src/gns/Makefile.am @@ -226,6 +226,7 @@ check_SCRIPTS = \ test_gns_pseu_shorten.sh\ test_gns_plus_lookup.sh\ test_gns_zkey_lookup.sh\ + test_gns_rel_expiration.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 18ebc04c5..17224fdf3 100644 --- a/src/gns/test_gns_lookup.conf +++ b/src/gns/test_gns_lookup.conf @@ -18,4 +18,5 @@ AUTO_IMPORT_PKEY = YES MAX_PARALLEL_BACKGROUND_QUERIES = 10 DEFAULT_LOOKUP_TIMEOUT = 15 s RECORD_PUT_INTERVAL = 1 h +ZONE_PUBLISH_TIME_WINDOW = 1 h diff --git a/src/gns/test_gns_rel_expiration.sh b/src/gns/test_gns_rel_expiration.sh new file mode 100755 index 000000000..c52262ded --- /dev/null +++ b/src/gns/test_gns_rel_expiration.sh @@ -0,0 +1,26 @@ +#!/bin/bash +trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT +rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f` +which timeout &> /dev/null && DO_TIMEOUT="timeout 5" +TEST_IP="127.0.0.1" +gnunet-arm -s -c test_gns_lookup.conf +gnunet-identity -C testego -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-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 '2 s' -c test_gns_lookup.conf +gnunet-arm -i gns -c test_gns_lookup.conf +sleep 1 +gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e '2 s' -c test_gns_lookup.conf +sleep 8 +RES_IP_EXP=`$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-identity -D testego -c test_gns_lookup.conf +gnunet-identity -D delegatedego -c test_gns_lookup.conf +gnunet-arm -e -c test_gns_lookup.conf + +if [ "$RES_IP_EXP" == "$TEST_IP" ] +then + echo "Failed to properly expire IP, got $RES_IP_EXP." + exit 1 +fi -- cgit v1.2.3