aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gns_rel_expiration.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/test_gns_rel_expiration.sh')
-rwxr-xr-xsrc/gns/test_gns_rel_expiration.sh25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/gns/test_gns_rel_expiration.sh b/src/gns/test_gns_rel_expiration.sh
index 9890641e2..992098db3 100755
--- a/src/gns/test_gns_rel_expiration.sh
+++ b/src/gns/test_gns_rel_expiration.sh
@@ -13,27 +13,30 @@ then
13 exit 77 13 exit 77
14fi 14fi
15 15
16MY_EGO="myego"
17OTHER_EGO="delegatedego"
18
16rm -rf /tmp/test-gnunet-gns-peer-1/ 19rm -rf /tmp/test-gnunet-gns-peer-1/
17which timeout &> /dev/null && DO_TIMEOUT="timeout 5" 20which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
18TEST_IP="127.0.0.1" 21TEST_IP="127.0.0.1"
19gnunet-arm -s -c test_gns_lookup.conf 22gnunet-arm -s -c test_gns_lookup.conf
20gnunet-identity -C testego -c test_gns_lookup.conf 23gnunet-identity -C $MY_EGO -c test_gns_lookup.conf
21gnunet-identity -C delegatedego -c test_gns_lookup.conf 24gnunet-identity -C $OTHER_EGO -c test_gns_lookup.conf
22DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep delegatedego | awk '{print $3}') 25DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep $OTHER_EGO | awk '{print $3}')
23gnunet-namestore -p -z testego -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf 26gnunet-namestore -p -z $MY_EGO -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
24gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e '5 s' -c test_gns_lookup.conf 27gnunet-namestore -p -z $OTHER_EGO -a -n www -t A -V $TEST_IP -e '5 s' -c test_gns_lookup.conf
25gnunet-arm -i gns -c test_gns_lookup.conf 28gnunet-arm -i gns -c test_gns_lookup.conf
26# confirm that lookup currently works 29# confirm that lookup currently works
27RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf` 30RES_IP=`$DO_TIMEOUT gnunet-gns --raw -u www.b.$MY_EGO -t A -c test_gns_lookup.conf`
28# remove entry 31# remove entry
29gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e '5 s' -c test_gns_lookup.conf 32gnunet-namestore -z $OTHER_EGO -d -n www -t A -V $TEST_IP -e '5 s' -c test_gns_lookup.conf
30# wait for old entry with 5s 'expiration' to definitively expire 33# wait for old entry with 5s 'expiration' to definitively expire
31sleep 6 34sleep 6
32# try again, should no longer work 35# try again, should no longer work
33RES_IP_EXP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf` 36RES_IP_EXP=`$DO_TIMEOUT gnunet-gns --raw -u www.b.$MY_EGO -t A -c test_gns_lookup.conf`
34gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf 37gnunet-namestore -z $MY_EGO -d -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
35gnunet-identity -D testego -c test_gns_lookup.conf 38gnunet-identity -D $MY_EGO -c test_gns_lookup.conf
36gnunet-identity -D delegatedego -c test_gns_lookup.conf 39gnunet-identity -D $OTHER_EGO -c test_gns_lookup.conf
37gnunet-arm -e -c test_gns_lookup.conf 40gnunet-arm -e -c test_gns_lookup.conf
38rm -rf /tmp/test-gnunet-gns-peer-1/ 41rm -rf /tmp/test-gnunet-gns-peer-1/
39 42