diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2013-09-27 15:32:46 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2013-09-27 15:32:46 +0000 |
commit | 0480fcc204575227c693bd83df3363909eb52022 (patch) | |
tree | 08c7c6d34a50c58901e0445718c1cade2e206fbf /src/gns/test_gns_dht_lookup.sh | |
parent | 3dec8134c10286f105073a283ca12226c31876d9 (diff) | |
download | gnunet-0480fcc204575227c693bd83df3363909eb52022.tar.gz gnunet-0480fcc204575227c693bd83df3363909eb52022.zip |
-dht test
Diffstat (limited to 'src/gns/test_gns_dht_lookup.sh')
-rwxr-xr-x | src/gns/test_gns_dht_lookup.sh | 25 |
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 | ||
2 | trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT | ||
3 | which timeout &> /dev/null && DO_TIMEOUT="timeout 5" | ||
4 | |||
5 | TEST_IP="127.0.0.1" | ||
6 | gnunet-arm -s -c test_gns_lookup.conf | ||
7 | gnunet-identity -C delegatedego -c test_gns_lookup.conf | ||
8 | DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep delegatedego | awk '{print $3}') | ||
9 | gnunet-identity -C testego -c test_gns_lookup.conf | ||
10 | gnunet-namestore -p -z testego -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf | ||
11 | gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf | ||
12 | gnunet-arm -i gns -c test_gns_lookup.conf | ||
13 | sleep 0.5 | ||
14 | gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf | ||
15 | RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf` | ||
16 | gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf | ||
17 | gnunet-arm -e -c test_gns_lookup.conf | ||
18 | |||
19 | if [ "$RES_IP" == "$TEST_IP" ] | ||
20 | then | ||
21 | exit 0 | ||
22 | else | ||
23 | echo "Failed to resolve to proper IP, got $RES_IP." | ||
24 | exit 1 | ||
25 | fi | ||