aboutsummaryrefslogtreecommitdiff
path: root/ascension
diff options
context:
space:
mode:
authorrexxnor <rexxnor+gnunet@brief.li>2019-05-01 14:52:31 +0200
committerrexxnor <rexxnor+gnunet@brief.li>2019-05-01 15:01:28 +0200
commit5bdbb5f19776aff0a9a673e1f0fd3c7aefe19650 (patch)
treeeffea67109025137c7b905006a84e596e0537e32 /ascension
parent714dd1a7629360ad72cdf4397dc01a9f803aecb4 (diff)
downloadascension-5bdbb5f19776aff0a9a673e1f0fd3c7aefe19650.tar.gz
ascension-5bdbb5f19776aff0a9a673e1f0fd3c7aefe19650.zip
switched to gnunet.gnu as test domain
Diffstat (limited to 'ascension')
-rw-r--r--ascension/ascension.py11
-rw-r--r--ascension/test/basic_named.conf2
-rw-r--r--ascension/test/gnunet.zone8
-rw-r--r--ascension/test/test_ascension_simple.sh34
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
16zone "gnunet.org" IN { 16zone "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
11gns--pkey--7h4hfww26fmdamt243dhssens2w5qevphbm9bhv54sz3cz1053ng IN A 0.0.0.0 11gns--pkey--7h4hfww26fmdamt243dhssens2w5qevphbm9bhv54sz3cz1053ng IN A 0.0.0.0
12foo IN AAAA 2002:: 12foo IN AAAA 2002::
@@ -18,7 +18,7 @@ www IN A 127.0.0.1
18$TTL 7200 18$TTL 7200
19owncloud IN A 127.0.0.1 19owncloud IN A 127.0.0.1
20nextcloud IN A 127.0.0.1 20nextcloud IN A 127.0.0.1
21mail IN MX 10 mail.gnunet.org. 21mail IN MX 10 mail.gnunet.gnu.
22mail IN A 127.0.0.1 22mail IN A 127.0.0.1
23multiple.subzones.dns IN A 127.0.0.1 23multiple.subzones.dns IN A 127.0.0.1
24subzones.dns IN A 127.1.1.1 24subzones.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
13cleanup() { 13cleanup() {
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
44named -c basic_named.conf -p 5000 44named -c basic_named.conf -p 5000
45 45
46# Check if domain resolves 46# Check if domain resolves
47nslookup -port=5000 gnunet.org 127.0.0.1 47nslookup -port=5000 gnunet.gnu localhost
48if [ "$?" -ne 0 ]; then 48if [ "$?" -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
52fi 52fi
53 53
54# Let ascension run on gnunet.org test domain 54# Let ascension run on gnunet.gnu test domain
55ascension gnunet.org -n 127.0.0.1 -p 5000 -s -d 55ascension gnunet.gnu -n localhost -p 5000 -s -d
56if [ "$?" -ne 0 ]; then 56if [ "$?" -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
80a=$(gnunet-gns -t CNAME -u asdf.gnunet.org) 80a=$(gnunet-gns -t CNAME -u asdf.gnunet.gnu)
81checkfailexp "$a" 81checkfailexp "$a"
82a=$(gnunet-gns -t AAAA -u foo.gnunet.org) 82a=$(gnunet-gns -t AAAA -u foo.gnunet.gnu)
83checkfailexp "$a" 83checkfailexp "$a"
84a=$(gnunet-gns -t A -u mail.gnunet.org) 84a=$(gnunet-gns -t A -u mail.gnunet.gnu)
85checkfailexp "$a" 85checkfailexp "$a"
86a=$(gnunet-gns -t A -u ns1.gnunet.org) 86a=$(gnunet-gns -t A -u ns1.gnunet.gnu)
87checkfailexp "$a" 87checkfailexp "$a"
88a=$(gnunet-gns -t A -u ns2.gnunet.org) 88a=$(gnunet-gns -t A -u ns2.gnunet.gnu)
89checkfailexp "$a" 89checkfailexp "$a"
90a=$(gnunet-gns -t A -u ns2.gnunet.org) 90a=$(gnunet-gns -t A -u ns2.gnunet.gnu)
91checkfailexp "$a" 91checkfailexp "$a"
92a=$(gnunet-gns -t MX -u mail.gnunet.org) 92a=$(gnunet-gns -t MX -u mail.gnunet.gnu)
93checkfailexp "$a" 93checkfailexp "$a"
94a=$(gnunet-gns -t A -u nextcloud.gnunet.org) 94a=$(gnunet-gns -t A -u nextcloud.gnunet.gnu)
95checkfailexp "$a" 95checkfailexp "$a"
96a=$(gnunet-gns -t SOA -u gnunet.org) 96a=$(gnunet-gns -t SOA -u gnunet.gnu)
97checkfailexp "$a" 97checkfailexp "$a"
98a=$(gnunet-gns -t A -u multiple.subzones.dns.gnunet.org) 98a=$(gnunet-gns -t A -u multiple.subzones.dns.gnunet.gnu)
99checkfailexp "$a" 99checkfailexp "$a"
100a=$(gnunet-gns -t A -u subzones.dns.gnunet.org) 100a=$(gnunet-gns -t A -u subzones.dns.gnunet.gnu)
101checkfailexp "$a" 101checkfailexp "$a"
102 102
103# cleanup if we get this far 103# cleanup if we get this far