[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Improve the output of the traceroute test
commit 249ae4895689dca3a69becb2116acd3dbacfa913
Author: Arturo Filastò <art@xxxxxxxxx>
Date: Fri Dec 27 17:37:30 2013 +0100
Improve the output of the traceroute test
---
ooni/nettests/manipulation/traceroute.py | 12 ++++++------
ooni/templates/scapyt.py | 4 ++--
ooni/utils/txscapy.py | 6 +++++-
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/ooni/nettests/manipulation/traceroute.py b/ooni/nettests/manipulation/traceroute.py
index 5d27fb7..aaa977a 100644
--- a/ooni/nettests/manipulation/traceroute.py
+++ b/ooni/nettests/manipulation/traceroute.py
@@ -54,7 +54,7 @@ class TracerouteTest(scapyt.BaseScapyTest):
with TTLs from 1 until max_ttl.
"""
def finished(packets, port):
- log.debug("Finished running TCP traceroute test on port %s" % port)
+ log.msg("Finished running TCP traceroute test on port %s" % port)
answered, unanswered = packets
self.report['test_tcp_traceroute']['hops_'+str(port)] = []
for snd, rcv in answered:
@@ -63,7 +63,7 @@ class TracerouteTest(scapyt.BaseScapyTest):
'rtt': rcv.time - snd.time,
'sport': snd[TCP].sport
}
- log.debug("%s: %s" % (port, report))
+ log.msg("%s: %s" % (port, report))
self.report['test_tcp_traceroute']['hops_'+str(port)].append(report)
dl = []
@@ -84,7 +84,7 @@ class TracerouteTest(scapyt.BaseScapyTest):
payloads with TTLs from 1 until max_ttl.
"""
def finished(packets, port):
- log.debug("Finished running UDP traceroute test on port %s" % port)
+ log.msg("Finished running UDP traceroute test on port %s" % port)
answered, unanswered = packets
self.report['test_udp_traceroute']['hops_'+str(port)] = []
for snd, rcv in answered:
@@ -93,7 +93,7 @@ class TracerouteTest(scapyt.BaseScapyTest):
'rtt': rcv.time - snd.time,
'sport': snd[UDP].sport
}
- log.debug("%s: %s" % (port, report))
+ log.msg("%s: %s" % (port, report))
self.report['test_udp_traceroute']['hops_'+str(port)].append(report)
dl = []
max_ttl, timeout = self.max_ttl_and_timeout()
@@ -113,7 +113,7 @@ class TracerouteTest(scapyt.BaseScapyTest):
packets with TTLs from 1 until max_ttl.
"""
def finished(packets):
- log.debug("Finished running ICMP traceroute test")
+ log.msg("Finished running ICMP traceroute test")
answered, unanswered = packets
self.report['test_icmp_traceroute']['hops'] = []
for snd, rcv in answered:
@@ -121,7 +121,7 @@ class TracerouteTest(scapyt.BaseScapyTest):
'address': rcv.src,
'rtt': rcv.time - snd.time
}
- log.debug("%s" % (report))
+ log.msg("%s" % (report))
self.report['test_icmp_traceroute']['hops'].append(report)
dl = []
max_ttl, timeout = self.max_ttl_and_timeout()
diff --git a/ooni/templates/scapyt.py b/ooni/templates/scapyt.py
index fdc5a24..a4d66c2 100644
--- a/ooni/templates/scapyt.py
+++ b/ooni/templates/scapyt.py
@@ -83,8 +83,8 @@ class BaseScapyTest(NetTestCase):
received_packet = rcv
if not config.privacy.includeip:
- log.msg("Detected you would not like to include your ip in the report")
- log.msg("Stripping source and destination IPs from the reports")
+ log.debug("Detected you would not like to include your ip in the report")
+ log.debug("Stripping source and destination IPs from the reports")
sent_packet.src = '127.0.0.1'
received_packet.dst = '127.0.0.1'
diff --git a/ooni/utils/txscapy.py b/ooni/utils/txscapy.py
index a5bb841..1012135 100644
--- a/ooni/utils/txscapy.py
+++ b/ooni/utils/txscapy.py
@@ -127,7 +127,11 @@ class ScapyFactory(abstract.FileDescriptor):
abstract.FileDescriptor.__init__(self, reactor)
if interface == 'auto':
- interface = getDefaultIface()
+ try:
+ interface = getDefaultIface()
+ except IfaceError:
+ log.err("Could not detect the default interface.")
+ log.msg("Try editing your config file to set it manually.")
if not super_socket:
super_socket = conf.L3socket(iface=interface,
promisc=True, filter='')
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits