commit 03cec435f36d43fdc0e47c0067548b92c41d55d5 Author: Simone Basso bassosimone@gmail.com Date: Sun Nov 15 15:58:54 2015 +0100
psiphon.py: prepare for merge with master
- for now check.torprokect.org will do
- for now it's OK to keep psiphon in the home directory
- couple of cosmetic changes --- ooni/nettests/third_party/psiphon.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-)
diff --git a/ooni/nettests/third_party/psiphon.py b/ooni/nettests/third_party/psiphon.py index 9fec2fd..637a505 100644 --- a/ooni/nettests/third_party/psiphon.py +++ b/ooni/nettests/third_party/psiphon.py @@ -59,22 +59,18 @@ class PsiphonTest(httpt.HTTPTest, process.ProcessTest): if self.localOptions['url']: self.url = self.localOptions['url'] else: - # FIXME: use http://google.com? - # self.url = 'https://wtfismyip.com/text' self.url = 'https://check.torproject.org'
if self.localOptions['psiphonpath']: self.psiphonpath = self.localOptions['psiphonpath'] else: - # FIXME: search for pyclient path instead of assuming is in the - # home? - # psiphon is not installable and to run it manually, it has to be + # Psiphon is not installable and to run it manually, it has to be # run from the psiphon directory, so it wouldn't make sense to - # nstall it in the PATH - from os import path, getenv + # install it in the PATH. For now, we assume that Psiphon sources + # are in the user's home directory. + from os import path, getenv self.psiphonpath = path.join( - getenv('HOME'), - 'psiphon-circumvention-system/pyclient') + getenv('HOME'), 'psiphon-circumvention-system/pyclient') log.debug('psiphon path: %s' % self.psiphonpath)
# psi_client.py can not be run directly because the paths in the @@ -92,7 +88,7 @@ connect(False) def handleRead(self, stdout, stderr): if 'Press Ctrl-C to terminate.' in self.processDirector.stdout: if not self.bootstrapped.called: - log.debug("PsiphonTest.test_psiphon: calling bootstrapped.callback") + log.debug("PsiphonTest: calling bootstrapped.callback") self.bootstrapped.callback(None)
def test_psiphon(self): @@ -114,9 +110,9 @@ connect(False) # full with some block size and therefore the test would # terminate with error finished = self.run(self.command, - env=dict(PYTHONPATH=self.psiphonpath), - path=self.psiphonpath, - usePTY=1) + env=dict(PYTHONPATH=self.psiphonpath), + path=self.psiphonpath, + usePTY=1)
def callDoRequest(_): return self.doRequest(self.url) @@ -130,6 +126,3 @@ connect(False)
self.bootstrapped.addBoth(cleanup) return self.bootstrapped - - -
tor-commits@lists.torproject.org