diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-02-19 21:52:43 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-02-19 21:52:54 +0100 |
commit | ca8202057d58faaed3e1fa6c57adf0aa003811c4 (patch) | |
tree | 3f479c09609394995e656967bd3a7caceb7f5ef1 /src/gns/test_gns_multiple_record_lookup.sh | |
parent | 3b2afcd3b931d56bf028aaf397014d27ff91b2a2 (diff) | |
download | gnunet-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-x | src/gns/test_gns_multiple_record_lookup.sh | 32 |
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 | |||
4 | trap "gnunet-arm -e -c test_gns_lookup_peer2.conf" INT | 4 | trap "gnunet-arm -e -c test_gns_lookup_peer2.conf" INT |
5 | which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5" | 5 | which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 5" |
6 | 6 | ||
7 | unset XDG_DATA_HOME | ||
8 | unset XDG_CONFIG_HOME | ||
9 | unset XDG_CACHE_HOME | ||
10 | |||
7 | LOCATION=$(which gnunet-config) | 11 | LOCATION=$(which gnunet-config) |
8 | if [ -z $LOCATION ] | 12 | if [ -z $LOCATION ] |
9 | then | 13 | then |
@@ -27,18 +31,40 @@ LABEL="fnord" | |||
27 | 31 | ||
28 | gnunet-arm -s -c test_gns_lookup_peer2.conf | 32 | gnunet-arm -s -c test_gns_lookup_peer2.conf |
29 | PKEY=`$DO_TIMEOUT gnunet-identity -V -C $OTHER_EGO -c test_gns_lookup_peer2.conf` | 33 | PKEY=`$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 | |||
47 | gnunet-arm -c test_gns_lookup_peer2.conf -k zonemaster | ||
48 | gnunet-arm -c test_gns_lookup_peer2.conf -k zonemaster-monitor | ||
49 | |||
30 | gnunet-namestore -p -z $OTHER_EGO -a -n $LABEL -t A -V $TEST_IP -e 3600s -c test_gns_lookup_peer2.conf | 50 | gnunet-namestore -p -z $OTHER_EGO -a -n $LABEL -t A -V $TEST_IP -e 3600s -c test_gns_lookup_peer2.conf |
31 | gnunet-namestore -p -z $OTHER_EGO -a -n $LABEL -t AAAA -V $TEST_IPV6 -e 3600s -c test_gns_lookup_peer2.conf | 51 | gnunet-namestore -p -z $OTHER_EGO -a -n $LABEL -t AAAA -V $TEST_IPV6 -e 3600s -c test_gns_lookup_peer2.conf |
32 | gnunet-namestore -D -z $OTHER_EGO -n $LABEL | 52 | gnunet-namestore -D -z $OTHER_EGO -n $LABEL |
33 | gnunet-arm -e -c test_gns_lookup_peer2.conf | ||
34 | 53 | ||
35 | echo "Second peer" | 54 | gnunet-arm -c test_gns_lookup_peer2.conf -i zonemaster |
55 | gnunet-arm -c test_gns_lookup_peer2.conf -i zonemaster-monitor | ||
56 | |||
57 | |||
36 | gnunet-arm -s -c test_gns_lookup_peer1.conf | 58 | gnunet-arm -s -c test_gns_lookup_peer1.conf |
37 | echo "Second peer started" | 59 | |
60 | |||
38 | RESP=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t ANY -c test_gns_lookup_peer1.conf` | 61 | RESP=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t ANY -c test_gns_lookup_peer1.conf` |
39 | RESP1=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t A -c test_gns_lookup_peer1.conf` | 62 | RESP1=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t A -c test_gns_lookup_peer1.conf` |
40 | RESP2=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t AAAA -c test_gns_lookup_peer1.conf` | 63 | RESP2=`$DO_TIMEOUT gnunet-gns --raw -u $LABEL.$PKEY -t AAAA -c test_gns_lookup_peer1.conf` |
64 | |||
65 | |||
41 | gnunet-arm -e -c test_gns_lookup_peer1.conf | 66 | gnunet-arm -e -c test_gns_lookup_peer1.conf |
67 | gnunet-arm -e -c test_gns_lookup_peer2.conf | ||
42 | 68 | ||
43 | rm -rf `gnunet-config -c test_gns_lookup_peer1.conf -f -s paths -o GNUNET_TEST_HOME` | 69 | rm -rf `gnunet-config -c test_gns_lookup_peer1.conf -f -s paths -o GNUNET_TEST_HOME` |
44 | rm -rf `gnunet-config -c test_gns_lookup_peer2.conf -f -s paths -o GNUNET_TEST_HOME` | 70 | rm -rf `gnunet-config -c test_gns_lookup_peer2.conf -f -s paths -o GNUNET_TEST_HOME` |