diff options
author | rexxnor <rexxnor+gnunet@brief.li> | 2020-01-30 10:48:04 +0100 |
---|---|---|
committer | rexxnor <rexxnor+gnunet@brief.li> | 2020-01-30 10:48:04 +0100 |
commit | 015cd279bf43981c9edae0d0b2802d6237d172b8 (patch) | |
tree | d64b46dd6589768c20dc826dde9cbdb2d04980c0 /src | |
parent | 722119a361fac268c08f5fa0ec7199a40e64cbbc (diff) | |
download | gnunet-015cd279bf43981c9edae0d0b2802d6237d172b8.tar.gz gnunet-015cd279bf43981c9edae0d0b2802d6237d172b8.zip |
added testing scripts for dns2gns
Diffstat (limited to 'src')
-rw-r--r-- | src/gns/test_dns2gns.conf | 68 | ||||
-rw-r--r-- | src/gns/test_dns2gns.sh | 50 |
2 files changed, 118 insertions, 0 deletions
diff --git a/src/gns/test_dns2gns.conf b/src/gns/test_dns2gns.conf new file mode 100644 index 000000000..3b034f8d5 --- /dev/null +++ b/src/gns/test_dns2gns.conf | |||
@@ -0,0 +1,68 @@ | |||
1 | @INLINE@ test_gns_defaults.conf | ||
2 | |||
3 | [namecache] | ||
4 | DISABLE = YES | ||
5 | |||
6 | [PATHS] | ||
7 | GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-gns-peer-1/ | ||
8 | |||
9 | [dht] | ||
10 | START_ON_DEMAND = YES | ||
11 | IMMEDIATE_START = YES | ||
12 | |||
13 | [gns] | ||
14 | # PREFIX = valgrind --leak-check=full --track-origins=yes | ||
15 | START_ON_DEMAND = YES | ||
16 | AUTO_IMPORT_PKEY = YES | ||
17 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 | ||
18 | DEFAULT_LOOKUP_TIMEOUT = 15 s | ||
19 | RECORD_PUT_INTERVAL = 1 h | ||
20 | ZONE_PUBLISH_TIME_WINDOW = 1 h | ||
21 | DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0 | ||
22 | |||
23 | [namestore] | ||
24 | IMMEDIATE_START = YES | ||
25 | #PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/ns_log | ||
26 | |||
27 | [revocation] | ||
28 | WORKBITS = 1 | ||
29 | |||
30 | [dhtcache] | ||
31 | QUOTA = 1 MB | ||
32 | DATABASE = heap | ||
33 | |||
34 | [topology] | ||
35 | TARGET-CONNECTION-COUNT = 16 | ||
36 | AUTOCONNECT = YES | ||
37 | FRIENDS-ONLY = NO | ||
38 | MINIMUM-FRIENDS = 0 | ||
39 | |||
40 | [ats] | ||
41 | WAN_QUOTA_IN = 1 GB | ||
42 | WAN_QUOTA_OUT = 1 GB | ||
43 | |||
44 | [transport] | ||
45 | plugins = tcp | ||
46 | NEIGHBOUR_LIMIT = 50 | ||
47 | PORT = 2091 | ||
48 | |||
49 | [transport-tcp] | ||
50 | TIMEOUT = 300 s | ||
51 | |||
52 | [nat] | ||
53 | DISABLEV6 = YES | ||
54 | BINDTO = 127.0.0.1 | ||
55 | ENABLE_UPNP = NO | ||
56 | BEHIND_NAT = NO | ||
57 | ALLOW_NAT = NO | ||
58 | INTERNAL_ADDRESS = 127.0.0.1 | ||
59 | EXTERNAL_ADDRESS = 127.0.0.1 | ||
60 | |||
61 | [dns2gns] | ||
62 | BINARY = gnunet-dns2gns | ||
63 | START_ON_DEMAND = YES | ||
64 | IMMEDIATE_START = YES | ||
65 | RUN_PER_USER = YES | ||
66 | BIND_TO = 127.0.0.1 | ||
67 | BIND_TO6 = ::1 | ||
68 | OPTIONS = -d 1.1.1.1 -p 12000 | ||
diff --git a/src/gns/test_dns2gns.sh b/src/gns/test_dns2gns.sh new file mode 100644 index 000000000..295bcc766 --- /dev/null +++ b/src/gns/test_dns2gns.sh | |||
@@ -0,0 +1,50 @@ | |||
1 | #!/bin/bash | ||
2 | # This file is in the public domain. | ||
3 | trap "gnunet-arm -e -c test_dns2gns.conf" INT | ||
4 | which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30" | ||
5 | |||
6 | LOCATION=$(which gnunet-config) | ||
7 | if [ -z $LOCATION ] | ||
8 | then | ||
9 | LOCATION="gnunet-config" | ||
10 | fi | ||
11 | $LOCATION --version 1> /dev/null | ||
12 | if test $? != 0 | ||
13 | then | ||
14 | echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" | ||
15 | exit 77 | ||
16 | fi | ||
17 | |||
18 | rm -rf `gnunet-config -c test_dns2gns.conf -f -s paths -o GNUNET_TEST_HOME` | ||
19 | MY_EGO="localego" | ||
20 | TEST_IP="127.0.0.1" | ||
21 | TEST_IPV6="dead::beef" | ||
22 | LABEL="fnord" | ||
23 | TEST_DOMAIN="gnunet.org" | ||
24 | |||
25 | gnunet-arm -s -c test_dns2gns.conf | ||
26 | PKEY=`gnunet-identity -V -C $MY_EGO -c test_dns2gns.conf` | ||
27 | gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t A -V $TEST_IP -e 3600s -c test_dns2gns.conf | ||
28 | gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t AAAA -V $TEST_IPV6 -e 3600s -c test_dns2gns.conf | ||
29 | |||
30 | # FIXME resolution works but always returns all available records | ||
31 | # also, the records seem to be returned twice if using GNS | ||
32 | |||
33 | if nslookup -port=12000 $LABEL.$PKEY localhost && nslookup -port=12000 $LABEL.$MY_EGO localhost; then | ||
34 | echo "PASS: GNS records can be resolved using dns2gns bridge" | ||
35 | else | ||
36 | echo "FAIL: GNS records can't be resolved using dns2gns bridge" | ||
37 | rm -rf `gnunet-config -c test_dns2gns.conf -f -s paths -o GNUNET_TEST_HOME` | ||
38 | exit 1 | ||
39 | fi | ||
40 | |||
41 | if nslookup -port=12000 gnunet.org localhost; then | ||
42 | echo "PASS: DNS records can be resolved using dns2gns bridge" | ||
43 | else | ||
44 | echo "FAIL: DNS records can't be resolved using dns2gns bridge" | ||
45 | rm -rf `gnunet-config -c test_dns2gns.conf -f -s paths -o GNUNET_TEST_HOME` | ||
46 | exit 1 | ||
47 | fi | ||
48 | gnunet-arm -e -c test_dns2gns.conf | ||
49 | |||
50 | rm -rf `gnunet-config -c test_dns2gns.conf -f -s paths -o GNUNET_TEST_HOME` | ||