[tor-commits] [ooni-probe/master] psiphon: fix bug that psiphon hangs ooniprobe -ng

art at torproject.org art at torproject.org
Fri Nov 20 14:42:00 UTC 2015


commit 1172083dff321c2544e4dfaa7c312528a0226512
Author: Simone Basso <bassosimone at gmail.com>
Date:   Sun Nov 15 16:58:37 2015 +0100

    psiphon: fix bug that psiphon hangs ooniprobe -ng
    
    Marked my fix with XXX because I'm not sure whether this is
    the proper approach, or whether it would be better to work on
    a patch to teach ooniprobe's core to deal with that case.
    
    For now, and given that a psiphon MVP must be delivered as
    soon as possible, this fix will do.
---
 ooni/nettests/third_party/psiphon.py |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/ooni/nettests/third_party/psiphon.py b/ooni/nettests/third_party/psiphon.py
index 637a505..543e856 100644
--- a/ooni/nettests/third_party/psiphon.py
+++ b/ooni/nettests/third_party/psiphon.py
@@ -95,12 +95,18 @@ connect(False)
         log.debug('PsiphonTest.test_psiphon')
 
         if not os.path.exists(self.psiphonpath):
-            log.debug('psiphon path does not exists, is it installed?')
+            log.err('psiphon path does not exists, is it installed?')
             self.report['success'] = False
             self.report['psiphon_installed'] = False
             log.debug("Adding %s to report" % self.report)
-            #FIXME: this completes the test but ooni doesn't stop running, why?
-            return defer.succeed(None)
+            # XXX: the original code written by juga0 readed
+            #     > return defer.succeed(None)
+            # but this caused `ooniprobe -ng` to hang forever, so I
+            # rewrote the code to return a deferred and simulate calling
+            # its callback method, to trigger an event.
+            #     -sbs
+            reactor.callLater(0.0, self.bootstrapped.callback, None)
+            return self.bootstrapped
 
         self.report['psiphon_installed'] = True
         log.debug("Adding %s to report" % self.report)





More information about the tor-commits mailing list