diff --git a/docs/source/tests/dnstamper.rst b/docs/source/tests/dnstamper.rst index 8fdb572d6..faa81a860 100644 --- a/docs/source/tests/dnstamper.rst +++ b/docs/source/tests/dnstamper.rst @@ -42,7 +42,7 @@ Sample report ============= From running: -`./bin/ooniprobe nettests/core/dnstamper.py -t test_inputs/dns_tamper_test_resolvers.txt -f test_inputs/http_host_file.txt` +`./bin/ooniprobe nettests/core/dnstamper.py -T test_inputs/dns_tamper_test_resolvers.txt -f test_inputs/http_host_file.txt` :: diff --git a/docs/source/writing_tests.rst b/docs/source/writing_tests.rst index ccc529a9c..3065b9e0c 100644 --- a/docs/source/writing_tests.rst +++ b/docs/source/writing_tests.rst @@ -168,7 +168,7 @@ To implement a simple ICMP ping based on this function you can do like so from ooni.templates import scapyt class UsageOptions(usage.Options): - optParameters = [['target', 't', '8.8.8.8', "Specify the target to ping"]] + optParameters = [['target', 't', '127.0.0.1', "Specify the target to ping"]] class ExampleICMPPingScapy(scapyt.BaseScapyTest): name = "Example ICMP Ping Test" @@ -205,7 +205,7 @@ regular sequential code. from ooni.templates import scapyt class UsageOptions(usage.Options): - optParameters = [['target', 't', self.localOptions['target'], "Specify the target to ping"]] + optParameters = [['target', 't', '127.0.0.1', "Specify the target to ping"]] class ExampleICMPPingScapyYield(scapyt.BaseScapyTest): name = "Example ICMP Ping Test" diff --git a/nettests/blocking/dnstamper.py b/nettests/blocking/dnstamper.py index 1ef2c8991..1e4d26023 100644 --- a/nettests/blocking/dnstamper.py +++ b/nettests/blocking/dnstamper.py @@ -114,7 +114,14 @@ def test_a_lookup(self): log.msg("Testing resolver: %s" % test_resolver) test_dns_server = (test_resolver, 53) - experiment_answers = yield self.performALookup(hostname, test_dns_server) + try: + experiment_answers = yield self.performALookup(hostname, test_dns_server) + except Exception, e: + log.err("Problem performing the DNS lookup") + log.exception(e) + self.report['tampering'][test_resolver] = 'dns_lookup_error' + continue + if not experiment_answers: log.err("Got no response, perhaps the DNS resolver is down?") self.report['tampering'][test_resolver] = 'no_answer'