aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gns_rel_expiration.sh
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2013-10-17 22:58:21 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2013-10-17 22:58:21 +0000
commit76ce26ad071dab7e058b8c8b83647b7fa544ad27 (patch)
treeb211f6f6b9313fbd74e67563f402f24eb87534bc /src/gns/test_gns_rel_expiration.sh
parent973fd069e1d43cc196e793e3a7ecadca9f3722db (diff)
downloadgnunet-76ce26ad071dab7e058b8c8b83647b7fa544ad27.tar.gz
gnunet-76ce26ad071dab7e058b8c8b83647b7fa544ad27.zip
expiration test
Diffstat (limited to 'src/gns/test_gns_rel_expiration.sh')
-rwxr-xr-xsrc/gns/test_gns_rel_expiration.sh26
1 files changed, 26 insertions, 0 deletions
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 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
3rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f`
4which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
5TEST_IP="127.0.0.1"
6gnunet-arm -s -c test_gns_lookup.conf
7gnunet-identity -C testego -c test_gns_lookup.conf
8gnunet-identity -C delegatedego -c test_gns_lookup.conf
9DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep delegatedego | awk '{print $3}')
10gnunet-namestore -p -z testego -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
11gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e '2 s' -c test_gns_lookup.conf
12gnunet-arm -i gns -c test_gns_lookup.conf
13sleep 1
14gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e '2 s' -c test_gns_lookup.conf
15sleep 8
16RES_IP_EXP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf`
17gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
18gnunet-identity -D testego -c test_gns_lookup.conf
19gnunet-identity -D delegatedego -c test_gns_lookup.conf
20gnunet-arm -e -c test_gns_lookup.conf
21
22if [ "$RES_IP_EXP" == "$TEST_IP" ]
23then
24 echo "Failed to properly expire IP, got $RES_IP_EXP."
25 exit 1
26fi