commit e93b1aaf1b13747bfc9b1761febe36552b862196 Author: Arun Pandian G arunpandianp@gmail.com Date: Sun Mar 23 09:18:47 2014 +0530
Replaced dnspython with ooni.templates.dnst for performing SOA Lookup in Captiveportal test --- ooni/nettests/manipulation/captiveportal.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/ooni/nettests/manipulation/captiveportal.py b/ooni/nettests/manipulation/captiveportal.py index 443b2ed..afaeee8 100644 --- a/ooni/nettests/manipulation/captiveportal.py +++ b/ooni/nettests/manipulation/captiveportal.py @@ -270,16 +270,14 @@ class CaptivePortal(httpt.HTTPTest,dnst.DNSTest): hostname = self.hostname_to_0x20(hostname)
for auth_ns in resolved_auth_ns: - res = resolver.Resolver(configure=False) - res.nameservers = [auth_ns] try: - answer = res.query(hostname, 'SOA') - except resolver.Timeout: + answer = yield self.performSOALookup(hostname,(auth_ns,53)) + except Exception: continue - querynames.append(answer.qname.to_text()) - answernames.append(answer.rrset.name.to_text()) + querynames.append(hostname) for soa in answer: - serials.append(str(soa.serial)) + answernames.append(soa[0]) + serials.append(str(soa[1]))
if len(set(querynames).intersection(answernames)) == 1: log.msg("Capitalization in DNS queries and responses match.")