commit a998fceb9418c0e06e8c79b41d486fee9bb8e7ab
Author: Arturo Filastò <art(a)fuffa.org>
Date: Tue Nov 20 20:40:14 2012 +0100
Do change of syntax to dns tamper test
---
before_i_commit.sh | 2 +-
nettests/core/dnstamper.py | 11 +++++------
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/before_i_commit.sh b/before_i_commit.sh
index 06af677..96117b3 100755
--- a/before_i_commit.sh
+++ b/before_i_commit.sh
@@ -14,7 +14,7 @@ rm before_i_commit.log
find . -type f -name "*.py[co]" -delete
-./bin/ooniprobe -l before_i_commit.log -o url_lists.yamloo nettests/core/url_list.py -f test_inputs/url_lists_file.txt
+./bin/ooniprobe -l before_i_commit.log -o http_url_lists.yamloo nettests/core/http_url_list.py -f test_inputs/url_lists_file.txt
./bin/ooniprobe -l before_i_commit.log -o dns_tamper_test.yamloo nettests/core/dnstamper.py -t test_inputs/dns_tamper_test_resolvers.txt -f test_inputs/dns_tamper_file.txt
diff --git a/nettests/core/dnstamper.py b/nettests/core/dnstamper.py
index be3281a..d007d77 100644
--- a/nettests/core/dnstamper.py
+++ b/nettests/core/dnstamper.py
@@ -26,10 +26,8 @@ from ooni import nettest
from ooni.utils import log
class UsageOptions(usage.Options):
- optParameters = [['backend', 'b', '8.8.8.8',
+ optParameters = [['backend', 'b', '8.8.8.8:53',
'The OONI backend that runs the DNS resolver'],
- ['backendport', 'p', 53,
- 'The port of the good DNS resolver'],
['testresolvers', 't', None,
'file containing list of DNS resolvers to test against']
]
@@ -46,7 +44,7 @@ class DNSTamperTest(dnst.DNSTest):
'Input file of list of hostnames to attempt to resolve']
usageOptions = UsageOptions
- requiredOptions = ['backend', 'backendport', 'file', 'testresolvers']
+ requiredOptions = ['backend', 'file', 'testresolvers']
def setUp(self):
@@ -62,8 +60,9 @@ class DNSTamperTest(dnst.DNSTest):
self.test_resolvers = [x.strip() for x in fp.readlines()]
fp.close()
- self.control_dns_server = (self.localOptions['backend'],
- int(self.localOptions['backendport']))
+
+ dns_ip, dns_port = self.localOptions['backend'].split(':')
+ self.control_dns_server = (dns_ip, int(dns_port))
self.report['test_resolvers'] = self.test_resolvers
self.report['control_resolver'] = self.control_dns_server