diff options
-rw-r--r-- | src/gns/test_gns_lookup_peer1.conf | 13 | ||||
-rw-r--r-- | src/gns/test_gns_lookup_peer2.conf | 16 | ||||
-rwxr-xr-x | src/gns/test_gns_multiple_record_lookup.sh | 32 |
3 files changed, 51 insertions, 10 deletions
diff --git a/src/gns/test_gns_lookup_peer1.conf b/src/gns/test_gns_lookup_peer1.conf index 3b034f8d5..1cf0ba628 100644 --- a/src/gns/test_gns_lookup_peer1.conf +++ b/src/gns/test_gns_lookup_peer1.conf | |||
@@ -5,6 +5,8 @@ DISABLE = YES | |||
5 | 5 | ||
6 | [PATHS] | 6 | [PATHS] |
7 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-gns-peer-1/ | 7 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-gns-peer-1/ |
8 | GNUNET_RUNTIME_DIR = $GNUNET_TMP/test-gnunet-gns-peer-1-system-runtime/ | ||
9 | GNUNET_USER_RUNTIME_DIR = $GNUNET_TMP/test-gnunet-gns-peer-1-user-runtime/ | ||
8 | 10 | ||
9 | [dht] | 11 | [dht] |
10 | START_ON_DEMAND = YES | 12 | START_ON_DEMAND = YES |
@@ -42,12 +44,17 @@ WAN_QUOTA_IN = 1 GB | |||
42 | WAN_QUOTA_OUT = 1 GB | 44 | WAN_QUOTA_OUT = 1 GB |
43 | 45 | ||
44 | [transport] | 46 | [transport] |
45 | plugins = tcp | 47 | plugins = unix |
46 | NEIGHBOUR_LIMIT = 50 | 48 | NEIGHBOUR_LIMIT = 50 |
47 | PORT = 2091 | 49 | PORT = 2091 |
48 | 50 | ||
49 | [transport-tcp] | 51 | [transport-unix] |
50 | TIMEOUT = 300 s | 52 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-transport-plugin-unix1.sock |
53 | |||
54 | [hostlist] | ||
55 | SERVERS = http://localhost:9999/ | ||
56 | OPTIONS = -b | ||
57 | IMMEDIATE_START = YES | ||
51 | 58 | ||
52 | [nat] | 59 | [nat] |
53 | DISABLEV6 = YES | 60 | DISABLEV6 = YES |
diff --git a/src/gns/test_gns_lookup_peer2.conf b/src/gns/test_gns_lookup_peer2.conf index d64fdcda3..2e861ff0a 100644 --- a/src/gns/test_gns_lookup_peer2.conf +++ b/src/gns/test_gns_lookup_peer2.conf | |||
@@ -5,6 +5,8 @@ DISABLE = YES | |||
5 | 5 | ||
6 | [PATHS] | 6 | [PATHS] |
7 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-gns-peer-2/ | 7 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-gns-peer-2/ |
8 | GNUNET_RUNTIME_DIR = $GNUNET_TMP/test-gnunet-gns-peer-2-runtime/ | ||
9 | GNUNET_USER_RUNTIME_DIR = $GNUNET_TMP/test-gnunet-gns-peer-2-user-runtime/ | ||
8 | 10 | ||
9 | [dht] | 11 | [dht] |
10 | START_ON_DEMAND = YES | 12 | START_ON_DEMAND = YES |
@@ -42,17 +44,23 @@ AUTOCONNECT = YES | |||
42 | FRIENDS-ONLY = NO | 44 | FRIENDS-ONLY = NO |
43 | MINIMUM-FRIENDS = 0 | 45 | MINIMUM-FRIENDS = 0 |
44 | 46 | ||
47 | [hostlist] | ||
48 | SERVERS = | ||
49 | HTTPPORT = 9999 | ||
50 | OPTIONS = -p | ||
51 | IMMEDIATE_START = YES | ||
52 | |||
53 | |||
45 | [ats] | 54 | [ats] |
46 | WAN_QUOTA_IN = 1 GB | 55 | WAN_QUOTA_IN = 1 GB |
47 | WAN_QUOTA_OUT = 1 GB | 56 | WAN_QUOTA_OUT = 1 GB |
48 | 57 | ||
49 | [transport] | 58 | [transport] |
50 | plugins = tcp | 59 | plugins = unix |
51 | NEIGHBOUR_LIMIT = 50 | 60 | NEIGHBOUR_LIMIT = 50 |
52 | PORT = 2092 | ||
53 | 61 | ||
54 | [transport-tcp] | 62 | [transport-unix] |
55 | TIMEOUT = 300 s | 63 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-transport-plugin-unix2.sock |
56 | 64 | ||
57 | [nat] | 65 | [nat] |
58 | DISABLEV6 = YES | 66 | DISABLEV6 = YES |
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` |