aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gns_dht_lookup.sh
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2013-09-27 15:32:46 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2013-09-27 15:32:46 +0000
commit0480fcc204575227c693bd83df3363909eb52022 (patch)
tree08c7c6d34a50c58901e0445718c1cade2e206fbf /src/gns/test_gns_dht_lookup.sh
parent3dec8134c10286f105073a283ca12226c31876d9 (diff)
downloadgnunet-0480fcc204575227c693bd83df3363909eb52022.tar.gz
gnunet-0480fcc204575227c693bd83df3363909eb52022.zip
-dht test
Diffstat (limited to 'src/gns/test_gns_dht_lookup.sh')
-rwxr-xr-xsrc/gns/test_gns_dht_lookup.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gns/test_gns_dht_lookup.sh b/src/gns/test_gns_dht_lookup.sh
new file mode 100755
index 000000000..2ddeda7b1
--- /dev/null
+++ b/src/gns/test_gns_dht_lookup.sh
@@ -0,0 +1,25 @@
1#!/bin/bash
2trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
3which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
4
5TEST_IP="127.0.0.1"
6gnunet-arm -s -c test_gns_lookup.conf
7gnunet-identity -C delegatedego -c test_gns_lookup.conf
8DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep delegatedego | awk '{print $3}')
9gnunet-identity -C testego -c test_gns_lookup.conf
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 never -c test_gns_lookup.conf
12gnunet-arm -i gns -c test_gns_lookup.conf
13sleep 0.5
14gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
15RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf`
16gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
17gnunet-arm -e -c test_gns_lookup.conf
18
19if [ "$RES_IP" == "$TEST_IP" ]
20then
21 exit 0
22else
23 echo "Failed to resolve to proper IP, got $RES_IP."
24 exit 1
25fi