[tor-commits] [ooni-probe/master] * Fixed bug in the assets parser.

isis at torproject.org isis at torproject.org
Sat Sep 15 14:31:04 UTC 2012


commit 21505f84aef5d60c7e138590a1a40e3df773d680
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sat Sep 15 07:49:29 2012 +0000

    * Fixed bug in the assets parser.
---
 .gitignore                  |    1 +
 ooni/assets/bridgetests.txt |    5 -----
 ooni/plugins/bridget.py     |   13 ++++++++++---
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7f270bb..686e319 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ proxy-lists/italy-http-ips.txt
 private/*
 /ooni/plugins/dropin.cache
 oonib/oonibackend.conf
+ooni/lib/txtorcon
\ No newline at end of file
diff --git a/ooni/assets/bridgetests.txt b/ooni/assets/bridgetests.txt
deleted file mode 100644
index 7bba841..0000000
--- a/ooni/assets/bridgetests.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-#213.151.89.102:9001
-#108.166.106.156:443
-#217.150.224.213:443
-85.193.252.111:443
-#68.98.41.14:9001
diff --git a/ooni/plugins/bridget.py b/ooni/plugins/bridget.py
index 745815f..49565d8 100644
--- a/ooni/plugins/bridget.py
+++ b/ooni/plugins/bridget.py
@@ -200,11 +200,11 @@ class BridgetTest(OONITest):
         ## we should probably find a more memory nice way to load addresses,
         ## in case the files are really large
         if self.local_options:
-            @staticmethod
+
             def make_asset_list(opt, lst):
                 log.msg("Loading information from %s ..." % opt)
                 with open(opt) as opt_file:
-                    for line in opt_file.readline():
+                    for line in opt_file.readlines():
                         if line.startswith('#'):
                             continue
                         else:
@@ -389,7 +389,7 @@ class BridgetTest(OONITest):
             if len(self.bridge_list) >= 1:
                 for bridge in self.bridge_list:
                     try:
-                        print "BRIDGE IS %s" % bridge
+                        log.msg("Current Bridge: %s" % bridge)
                         reconf_controller(self.config, bridge)
                     except:
                         reconf_fail(bridge)
@@ -421,6 +421,10 @@ bridget = BridgetTest(None, None, None)
 ## -----------
 ## self.config.save() only needs to be called if Tor is already running.
 ## 
+## to test gid, uid, and euid:
+## with open('/proc/self/state') as uidfile:
+##     print uidfile.read(1000)
+##
 ## TODO:
 ##       o  add option for any kwarg=arg self.config setting
 ##       o  cleanup documentation
@@ -428,6 +432,9 @@ bridget = BridgetTest(None, None, None)
 ##       o  check if bridges are public relays
 ##       o  take bridge_desc file as input, also be able to give same
 ##          format as output
+##       o  Add assychronous timout for deferred, so that we don't wait 
+##          forever for bridges that don't work.
+##       o  Add mechanism for testing through another host
 ##
 ## FIX:
 ##       o  DataDirectory is not found, or permissions aren't right



More information about the tor-commits mailing list