aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gns_multiple_record_lookup.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-02-19 21:52:43 +0100
committerChristian Grothoff <christian@grothoff.org>2020-02-19 21:52:54 +0100
commitca8202057d58faaed3e1fa6c57adf0aa003811c4 (patch)
tree3f479c09609394995e656967bd3a7caceb7f5ef1 /src/gns/test_gns_multiple_record_lookup.sh
parent3b2afcd3b931d56bf028aaf397014d27ff91b2a2 (diff)
downloadgnunet-ca8202057d58faaed3e1fa6c57adf0aa003811c4.tar.gz
gnunet-ca8202057d58faaed3e1fa6c57adf0aa003811c4.zip
fixing the GNS multirecord multipeer test
Diffstat (limited to 'src/gns/test_gns_multiple_record_lookup.sh')
-rwxr-xr-xsrc/gns/test_gns_multiple_record_lookup.sh32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/gns/test_gns_multiple_record_lookup.sh b/src/gns/test_gns_multiple_record_lookup.sh
index fbd9a6b13..2d00945d6 100755
--- a/src/gns/test_gns_multiple_record_lookup.sh
+++ b/src/gns/test_gns_multiple_record_lookup.sh
@@ -4,6 +4,10 @@ trap "gnunet-arm -e -c test_gns_lookup_peer1.conf" INT
4trap "gnunet-arm -e -c test_gns_lookup_peer2.conf" INT 4trap "gnunet-arm -e -c test_gns_lookup_peer2.conf" INT
5which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5" 5which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5"
6 6
7unset XDG_DATA_HOME
8unset XDG_CONFIG_HOME
9unset XDG_CACHE_HOME
10
7LOCATION=$(which gnunet-config) 11LOCATION=$(which gnunet-config)
8if [ -z $LOCATION ] 12if [ -z $LOCATION ]
9then 13then
@@ -27,18 +31,40 @@ LABEL="fnord"
27 31
28gnunet-arm -s -c test_gns_lookup_peer2.conf 32gnunet-arm -s -c test_gns_lookup_peer2.conf
29PKEY=`$DO_TIMEOUT gnunet-identity -V -C $OTHER_EGO -c test_gns_lookup_peer2.conf` 33PKEY=`$DO_TIMEOUT gnunet-identity -V -C $OTHER_EGO -c test_gns_lookup_peer2.conf`
34
35# Note: if zonemaster is kept running, it MAY publish the "A" record in the
36# DHT immediately and then _LATER_ also the "AAAA" record. But as then there
37# will be TWO valid blocks in the DHT (one with only A and one with A and
38# AAAA), the subsequent GET for both may fail and only return the result with
39# just the "A" record).
40# If we _waited_ until the original block with just "A" expired, everything
41# would be fine, but we don't want to do that for the test, so we
42# simply pause publishing to the DHT until all records are defined.
43# In the future, it would be good to have an enhanced gnunet-namestore command
44# that would read a series of changes to be made to a record set from
45# stdin and do them _all_ *atomically*. Then we would not need to do this.
46
47gnunet-arm -c test_gns_lookup_peer2.conf -k zonemaster
48gnunet-arm -c test_gns_lookup_peer2.conf -k zonemaster-monitor
49
30gnunet-namestore -p -z $OTHER_EGO -a -n $LABEL -t A -V $TEST_IP -e 3600s -c test_gns_lookup_peer2.conf 50gnunet-namestore -p -z $OTHER_EGO -a -n $LABEL -t A -V $TEST_IP -e 3600s -c test_gns_lookup_peer2.conf
31gnunet-namestore -p -z $OTHER_EGO -a -n $LABEL -t AAAA -V $TEST_IPV6 -e 3600s -c test_gns_lookup_peer2.conf 51gnunet-namestore -p -z $OTHER_EGO -a -n $LABEL -t AAAA -V $TEST_IPV6 -e 3600s -c test_gns_lookup_peer2.conf
32gnunet-namestore -D -z $OTHER_EGO -n $LABEL 52gnunet-namestore -D -z $OTHER_EGO -n $LABEL
33gnunet-arm -e -c test_gns_lookup_peer2.conf
34 53
35echo "Second peer" 54gnunet-arm -c test_gns_lookup_peer2.conf -i zonemaster
55gnunet-arm -c test_gns_lookup_peer2.conf -i zonemaster-monitor
56
57
36gnunet-arm -s -c test_gns_lookup_peer1.conf 58gnunet-arm -s -c test_gns_lookup_peer1.conf
37echo "Second peer started" 59
60
38RESP=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t ANY -c test_gns_lookup_peer1.conf` 61RESP=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t ANY -c test_gns_lookup_peer1.conf`
39RESP1=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t A -c test_gns_lookup_peer1.conf` 62RESP1=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t A -c test_gns_lookup_peer1.conf`
40RESP2=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t AAAA -c test_gns_lookup_peer1.conf` 63RESP2=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t AAAA -c test_gns_lookup_peer1.conf`
64
65
41gnunet-arm -e -c test_gns_lookup_peer1.conf 66gnunet-arm -e -c test_gns_lookup_peer1.conf
67gnunet-arm -e -c test_gns_lookup_peer2.conf
42 68
43rm -rf `gnunet-config -c test_gns_lookup_peer1.conf -f -s paths -o GNUNET_TEST_HOME` 69rm -rf `gnunet-config -c test_gns_lookup_peer1.conf -f -s paths -o GNUNET_TEST_HOME`
44rm -rf `gnunet-config -c test_gns_lookup_peer2.conf -f -s paths -o GNUNET_TEST_HOME` 70rm -rf `gnunet-config -c test_gns_lookup_peer2.conf -f -s paths -o GNUNET_TEST_HOME`