Opened 7 years ago

Closed 7 years ago

#7714 closed defect (user disappeared)

nettests/blocking/dnstamper.py fails if one of the DNS resolver Timeout

Reported by: zion Owned by: hellais
Priority: Medium Milestone:
Component: Archived/Ooni Version:
Severity: Keywords: oonib, dnstamper
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

If one of the DNS resolver timeouts, the dnstamper.py stops and gives no report at all, leaving only options.

$ ./bin/ooniprobe nettests/blocking/dnstamper.py -f test-hostname.txt -T test-dnsresolver.txt
Log opened.
No test deck detected
[D] processing options
[D] Checking if backend is present
[D] Checking if file is present
[D] Running [(<class 'nettests.blocking.dnstamper.DNSTamperTest'>, 'test_a_lookup')]
[D] Options {'inputs': <ooni.nettest.inputProcessorIterator object at 0x3299c90>, 'version': '0.4', 'name': 'DNS tamper'}
[D] cmd_line_options {'pcapfile': None, 'help': 0, 'subargs': ('-f', 'test-hostname.txt', '-T', 'test-dnsresolver.txt'), 'resume': 0, 'test': 'nettests/blocking/dnstamper.py', 'logfile': None, 'collector': None, 'reportfile': None}
Traceback (most recent call last):

File "/home/user/Develop/ooni-probe/ooni/reporter.py", line 275, in init

socksport=int(config.tor.socks_port))

TypeError: int() argument must be a string or a number, not 'NoneType'
[D] Creating report_dnstamper_2012-12-12T194201Z.yamloo
[D] Writing report with YAML reporter
Reporting to file report_dnstamper_2012-12-12T194201Z.yamloo
[D] Not going to resume dnstamper.py
[D] Running dnstamper default processor
[D] input_unit_items: 1.0
[D] test_case_number: 1.0
[D] Test case number: 1.0
[D] Total iterations: 1.0
[D] Current iteration: 0.0
[D] Running dnstamper default processor
[D] Running dnstamper.py with input unit <<class 'ooni.inputunit.InputUnit'> inputs=<listiterator object at 0x3311cd0>>
[D] Running test cases with input unit
[D] Running test with this input www.mit.edu
[D] Processing test_a_lookup
Running test_a_lookup with www.mit.edu...
Doing the test lookups on www.mit.edu
DNSDatagramProtocol starting on 23406
Starting protocol <twisted.names.dns.DNSDatagramProtocol object at 0x3311d90>
[D] Running test with this input www.edu.cn
[D] Processing test_a_lookup
Running test_a_lookup with www.edu.cn...
Doing the test lookups on www.edu.cn
DNSDatagramProtocol starting on 43458
Starting protocol <twisted.names.dns.DNSDatagramProtocol object at 0x331e090>
[dnstamper.py] 0.0%
[D] Adding [Query('www.mit.edu', 1, 1)] to report)
Testing resolver: 8.8.8.1
DNSDatagramProtocol starting on 40508
Starting protocol <twisted.names.dns.DNSDatagramProtocol object at 0x331e390>
(UDP Port 23406 Closed)
Stopping protocol <twisted.names.dns.DNSDatagramProtocol object at 0x3311d90>
[D] Adding [Query('www.edu.cn', 1, 1)] to report)
Testing resolver: 8.8.8.1
DNSDatagramProtocol starting on 24444
Starting protocol <twisted.names.dns.DNSDatagramProtocol object at 0x3311dd0>
(UDP Port 43458 Closed)
Stopping protocol <twisted.names.dns.DNSDatagramProtocol object at 0x331e090>
[D] Adding [Query('www.mit.edu', 1, 1)] to report)
[!] Deferred Timed Out Error
[!] Error in running test_a_lookup
Traceback (most recent call last):
Failure: twisted.internet.defer.TimeoutError: [Query('www.mit.edu', 1, 1)]
[D] No post processor configured
(UDP Port 40508 Closed)
Stopping protocol <twisted.names.dns.DNSDatagramProtocol object at 0x331e390>
[D] Adding [Query('www.edu.cn', 1, 1)] to report)
[!] Deferred Timed Out Error
[!] Error in running test_a_lookup
Traceback (most recent call last):
Failure: twisted.internet.defer.TimeoutError: [Query('www.edu.cn', 1, 1)]
[D] No post processor configured
[D] Acquiring lock for dnstamper.py
[D] Releasing lock for dnstamper.py
[D] input_unit_items: 1.0
[D] test_case_number: 1.0
[D] Test case number: 1.0
[D] Total iterations: 1.0
[D] Current iteration: 1.0
[D] testsEnded: Finished running all tests
Main loop terminated.

$ more report_dnstamper_2012-12-12T194201Z.yamloo
###########################################
# OONI Probe Report for DNS tamper test
# Thu Dec 13 03:42:01 2012
###########################################
---
options:

collector: null
help: 0
logfile: null
pcapfile: null
reportfile: null
resume: 0
subargs: [-f, test-hostname.txt, -T, test-dnsresolver.txt]
test: nettests/blocking/dnstamper.py

probe_asn: AS0
probe_cc: null
probe_ip: 127.0.0.1
software_name: ooniprobe
software_version: 0.0.8
start_time: 1355312521.0
test_name: DNS tamper
test_version: '0.4'
...

$ git log
commit 9212cbabcfc297564d886ddc5b884833a4c8dd30
Author: Arturo Filastò <art@…>
Date: Tue Dec 11 11:45:16 2012 +0100

Clean up HTTP Header Field Manipulation test documentation

commit 53ed7f69ff809e20eeaaaa4e3797e1da155de6a2
Author: Arturo Filastò <art@…>
Date: Sun Dec 9 14:01:16 2012 +0100

Explicitly state that reactor.stop and reactor.start should not be called from inside test methods

commit fb9d25b80d761532c41034fffc255244b3175fab
Author: Arturo Filastò <art@…>
Date: Sun Dec 9 01:08:19 2012 +0100

Do not call reactor.stop in netalyzr test.

Child Tickets

Change History (2)

comment:1 Changed 7 years ago by hellais

Status: newneeds_revision

I have pushed a fix to this bug: https://gitweb.torproject.org/ooni-probe.git/commitdiff/a06c913ccd30dbe02cb1e7a6e3d89fca8aaaba1f.

Can you verify that this is working as expected?

Thanks!

comment:2 Changed 7 years ago by hellais

Resolution: user disappeared
Status: needs_revisionclosed

This has been tested and appears to be working.

Note: See TracTickets for help on using tickets.