diff options
author | rexxnor <rexxnor+gnunet@brief.li> | 2019-05-01 14:52:31 +0200 |
---|---|---|
committer | rexxnor <rexxnor+gnunet@brief.li> | 2019-05-01 15:01:28 +0200 |
commit | 5bdbb5f19776aff0a9a673e1f0fd3c7aefe19650 (patch) | |
tree | effea67109025137c7b905006a84e596e0537e32 /ascension | |
parent | 714dd1a7629360ad72cdf4397dc01a9f803aecb4 (diff) | |
download | ascension-5bdbb5f19776aff0a9a673e1f0fd3c7aefe19650.tar.gz ascension-5bdbb5f19776aff0a9a673e1f0fd3c7aefe19650.zip |
switched to gnunet.gnu as test domain
Diffstat (limited to 'ascension')
-rw-r--r-- | ascension/ascension.py | 11 | ||||
-rw-r--r-- | ascension/test/basic_named.conf | 2 | ||||
-rw-r--r-- | ascension/test/gnunet.zone | 8 | ||||
-rw-r--r-- | ascension/test/test_ascension_simple.sh | 34 |
4 files changed, 27 insertions, 28 deletions
diff --git a/ascension/ascension.py b/ascension/ascension.py index db25a12..4d521b4 100644 --- a/ascension/ascension.py +++ b/ascension/ascension.py | |||
@@ -131,13 +131,13 @@ class Ascender(): | |||
131 | # compared to AXFR/IXFR - changed to respect this | 131 | # compared to AXFR/IXFR - changed to respect this |
132 | try: | 132 | try: |
133 | soa_answer = dns.resolver.query(domain, 'SOA') | 133 | soa_answer = dns.resolver.query(domain, 'SOA') |
134 | master_answer = myresolver.query(soa_answer[0].mname, 'A') | ||
134 | except dns.resolver.NoAnswer: | 135 | except dns.resolver.NoAnswer: |
135 | logging.warning("The domain '%s' is not publicly resolvable.", | 136 | logging.warning("The domain '%s' is not publicly resolvable.", |
136 | domain) | 137 | domain) |
137 | except dns.resolver.NXDOMAIN: | 138 | except dns.resolver.NXDOMAIN: |
138 | logging.warning("The domain '%s' is not publicly resolvable.", | 139 | logging.warning("The domain '%s' is not publicly resolvable.", |
139 | domain) | 140 | domain) |
140 | master_answer = dns.resolver.query(soa_answer[0].mname, 'A') | ||
141 | try: | 141 | try: |
142 | if resolver: | 142 | if resolver: |
143 | zone = dns.zone.from_xfr(dns.query.xfr( | 143 | zone = dns.zone.from_xfr(dns.query.xfr( |
@@ -150,12 +150,11 @@ class Ascender(): | |||
150 | logging.error("Nameserver for '%s' did not answer.", domain) | 150 | logging.error("Nameserver for '%s' did not answer.", domain) |
151 | except dns.exception.FormError: | 151 | except dns.exception.FormError: |
152 | logging.critical("Domain '%s' does not allow xfr requests.", domain) | 152 | logging.critical("Domain '%s' does not allow xfr requests.", domain) |
153 | # FIXME: do not exit, throw exception, catch in main, retry based on GNS SOA (or default value) | 153 | return None |
154 | sys.exit(1) | ||
155 | except dns.query.TransferError: | 154 | except dns.query.TransferError: |
156 | logging.critical("Domain '%s' does not allow xfr requests.", domain) | 155 | logging.critical("Domain '%s' does not allow xfr requests.", domain) |
157 | # FIXME: do not exit, throw exception, catch in main, retry based on GNS SOA (or default value) | 156 | return None |
158 | sys.exit(1) | 157 | |
159 | for soa_record in zone.iterate_rdatas(rdtype=dns.rdatatype.SOA): | 158 | for soa_record in zone.iterate_rdatas(rdtype=dns.rdatatype.SOA): |
160 | if not cls.transferns: | 159 | if not cls.transferns: |
161 | mname = soa_record[2].mname | 160 | mname = soa_record[2].mname |
@@ -746,7 +745,7 @@ def main(): | |||
746 | if standalone: | 745 | if standalone: |
747 | return 2 | 746 | return 2 |
748 | time.sleep(retry) | 747 | time.sleep(retry) |
749 | continue | 748 | continue |
750 | 749 | ||
751 | # FIXME: return value (or exception) to observe success/failure of operation! | 750 | # FIXME: return value (or exception) to observe success/failure of operation! |
752 | ascender.add_records_to_gns() | 751 | ascender.add_records_to_gns() |
diff --git a/ascension/test/basic_named.conf b/ascension/test/basic_named.conf index 608e7cb..932ca4d 100644 --- a/ascension/test/basic_named.conf +++ b/ascension/test/basic_named.conf | |||
@@ -13,7 +13,7 @@ options { | |||
13 | server-id none; | 13 | server-id none; |
14 | }; | 14 | }; |
15 | 15 | ||
16 | zone "gnunet.org" IN { | 16 | zone "gnunet.gnu" IN { |
17 | type master; | 17 | type master; |
18 | file "gnunet.zone"; | 18 | file "gnunet.zone"; |
19 | allow-query { any; }; | 19 | allow-query { any; }; |
diff --git a/ascension/test/gnunet.zone b/ascension/test/gnunet.zone index 0bef20f..5ddc693 100644 --- a/ascension/test/gnunet.zone +++ b/ascension/test/gnunet.zone | |||
@@ -1,12 +1,12 @@ | |||
1 | $TTL 3600 | 1 | $TTL 3600 |
2 | @ IN SOA ns1.gnunet.org. root.gnunet.org. ( | 2 | @ IN SOA ns1.gnunet.gnu. root.gnunet.gnu. ( |
3 | 2018090830 ; Serial | 3 | 2018090830 ; Serial |
4 | 3600 ; Refresh | 4 | 3600 ; Refresh |
5 | 1800 ; Retry | 5 | 1800 ; Retry |
6 | 604800 ; Expire | 6 | 604800 ; Expire |
7 | 3600 ) ; Negative Cache TTL | 7 | 3600 ) ; Negative Cache TTL |
8 | @ IN NS ns1.gnunet.org. | 8 | @ IN NS ns1.gnunet.gnu. |
9 | @ IN NS gns--pkey--7h4hfww26fmdamt243dhssens2w5qevphbm9bhv54sz3cz1053ng.gnunet.org. | 9 | @ IN NS gns--pkey--7h4hfww26fmdamt243dhssens2w5qevphbm9bhv54sz3cz1053ng.gnunet.gnu. |
10 | @ IN A 127.0.0.1 | 10 | @ IN A 127.0.0.1 |
11 | gns--pkey--7h4hfww26fmdamt243dhssens2w5qevphbm9bhv54sz3cz1053ng IN A 0.0.0.0 | 11 | gns--pkey--7h4hfww26fmdamt243dhssens2w5qevphbm9bhv54sz3cz1053ng IN A 0.0.0.0 |
12 | foo IN AAAA 2002:: | 12 | foo IN AAAA 2002:: |
@@ -18,7 +18,7 @@ www IN A 127.0.0.1 | |||
18 | $TTL 7200 | 18 | $TTL 7200 |
19 | owncloud IN A 127.0.0.1 | 19 | owncloud IN A 127.0.0.1 |
20 | nextcloud IN A 127.0.0.1 | 20 | nextcloud IN A 127.0.0.1 |
21 | mail IN MX 10 mail.gnunet.org. | 21 | mail IN MX 10 mail.gnunet.gnu. |
22 | mail IN A 127.0.0.1 | 22 | mail IN A 127.0.0.1 |
23 | multiple.subzones.dns IN A 127.0.0.1 | 23 | multiple.subzones.dns IN A 127.0.0.1 |
24 | subzones.dns IN A 127.1.1.1 | 24 | subzones.dns IN A 127.1.1.1 |
diff --git a/ascension/test/test_ascension_simple.sh b/ascension/test/test_ascension_simple.sh index 1f01c62..1b3640b 100644 --- a/ascension/test/test_ascension_simple.sh +++ b/ascension/test/test_ascension_simple.sh | |||
@@ -12,9 +12,9 @@ | |||
12 | # Shutdown named | 12 | # Shutdown named |
13 | cleanup() { | 13 | cleanup() { |
14 | pkill named | 14 | pkill named |
15 | gnunet-identity -D gnunet.org | 15 | gnunet-identity -D gnunet.gnu |
16 | gnunet-identity -D dns.gnunet.org | 16 | gnunet-identity -D dns.gnunet.gnu |
17 | gnunet-identity -D subzones.dns.gnunet.org | 17 | gnunet-identity -D subzones.dns.gnunet.gnu |
18 | } | 18 | } |
19 | 19 | ||
20 | # Check for required packages | 20 | # Check for required packages |
@@ -44,15 +44,15 @@ fi | |||
44 | named -c basic_named.conf -p 5000 | 44 | named -c basic_named.conf -p 5000 |
45 | 45 | ||
46 | # Check if domain resolves | 46 | # Check if domain resolves |
47 | nslookup -port=5000 gnunet.org 127.0.0.1 | 47 | nslookup -port=5000 gnunet.gnu localhost |
48 | if [ "$?" -ne 0 ]; then | 48 | if [ "$?" -ne 0 ]; then |
49 | echo "Something went wrong with named" | 49 | echo "Something went wrong with named" |
50 | cleanup | 50 | cleanup |
51 | exit 1 | 51 | exit 1 |
52 | fi | 52 | fi |
53 | 53 | ||
54 | # Let ascension run on gnunet.org test domain | 54 | # Let ascension run on gnunet.gnu test domain |
55 | ascension gnunet.org -n 127.0.0.1 -p 5000 -s -d | 55 | ascension gnunet.gnu -n localhost -p 5000 -s -d |
56 | if [ "$?" -ne 0 ]; then | 56 | if [ "$?" -ne 0 ]; then |
57 | echo "ascension failed adding the records!" | 57 | echo "ascension failed adding the records!" |
58 | cleanup | 58 | cleanup |
@@ -77,27 +77,27 @@ checkfailimp() { | |||
77 | } | 77 | } |
78 | 78 | ||
79 | # TESTING explicit records | 79 | # TESTING explicit records |
80 | a=$(gnunet-gns -t CNAME -u asdf.gnunet.org) | 80 | a=$(gnunet-gns -t CNAME -u asdf.gnunet.gnu) |
81 | checkfailexp "$a" | 81 | checkfailexp "$a" |
82 | a=$(gnunet-gns -t AAAA -u foo.gnunet.org) | 82 | a=$(gnunet-gns -t AAAA -u foo.gnunet.gnu) |
83 | checkfailexp "$a" | 83 | checkfailexp "$a" |
84 | a=$(gnunet-gns -t A -u mail.gnunet.org) | 84 | a=$(gnunet-gns -t A -u mail.gnunet.gnu) |
85 | checkfailexp "$a" | 85 | checkfailexp "$a" |
86 | a=$(gnunet-gns -t A -u ns1.gnunet.org) | 86 | a=$(gnunet-gns -t A -u ns1.gnunet.gnu) |
87 | checkfailexp "$a" | 87 | checkfailexp "$a" |
88 | a=$(gnunet-gns -t A -u ns2.gnunet.org) | 88 | a=$(gnunet-gns -t A -u ns2.gnunet.gnu) |
89 | checkfailexp "$a" | 89 | checkfailexp "$a" |
90 | a=$(gnunet-gns -t A -u ns2.gnunet.org) | 90 | a=$(gnunet-gns -t A -u ns2.gnunet.gnu) |
91 | checkfailexp "$a" | 91 | checkfailexp "$a" |
92 | a=$(gnunet-gns -t MX -u mail.gnunet.org) | 92 | a=$(gnunet-gns -t MX -u mail.gnunet.gnu) |
93 | checkfailexp "$a" | 93 | checkfailexp "$a" |
94 | a=$(gnunet-gns -t A -u nextcloud.gnunet.org) | 94 | a=$(gnunet-gns -t A -u nextcloud.gnunet.gnu) |
95 | checkfailexp "$a" | 95 | checkfailexp "$a" |
96 | a=$(gnunet-gns -t SOA -u gnunet.org) | 96 | a=$(gnunet-gns -t SOA -u gnunet.gnu) |
97 | checkfailexp "$a" | 97 | checkfailexp "$a" |
98 | a=$(gnunet-gns -t A -u multiple.subzones.dns.gnunet.org) | 98 | a=$(gnunet-gns -t A -u multiple.subzones.dns.gnunet.gnu) |
99 | checkfailexp "$a" | 99 | checkfailexp "$a" |
100 | a=$(gnunet-gns -t A -u subzones.dns.gnunet.org) | 100 | a=$(gnunet-gns -t A -u subzones.dns.gnunet.gnu) |
101 | checkfailexp "$a" | 101 | checkfailexp "$a" |
102 | 102 | ||
103 | # cleanup if we get this far | 103 | # cleanup if we get this far |