diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2018-08-05 16:27:49 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-12 09:06:16 -0400 |
commit | 5a11670fcaad0a58de48425ba80510effbe35628 (patch) | |
tree | f5af3a3f3ac6298a99c01c6e3f7e640b8f9592bb /src | |
parent | 4811869d7a603dfb6cc9881bb5aae9815ceab4e5 (diff) | |
download | tor-5a11670fcaad0a58de48425ba80510effbe35628.tar.gz tor-5a11670fcaad0a58de48425ba80510effbe35628.zip |
Update/fix CI build
Update integration test to Python 3
Diffstat (limited to 'src')
-rw-r--r-- | src/test/test_rebind.py | 14 | ||||
-rwxr-xr-x | src/test/test_rebind.sh | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/test/test_rebind.py b/src/test/test_rebind.py index 9472d5cef5..f02cb79b78 100644 --- a/src/test/test_rebind.py +++ b/src/test/test_rebind.py @@ -1,3 +1,5 @@ +#!/usr/bin/python3 + from __future__ import print_function import sys @@ -18,14 +20,14 @@ def try_connecting_to_socksport(): def wait_for_log(s): while True: l = tor_process.stdout.readline() - if s in l: + if s in l.decode('utf8'): return def pick_random_port(): port = 0 random.seed() - for i in xrange(8): + for i in range(8): port = random.randint(10000, 60000) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if s.connect_ex(('127.0.0.1', port)) == 0: @@ -69,18 +71,18 @@ if control_socket.connect_ex(('127.0.0.1', control_port)): print('FAIL') sys.exit('Cannot connect to ControlPort') -control_socket.sendall('AUTHENTICATE \r\n') -control_socket.sendall('SETCONF SOCKSPort=0.0.0.0:{}\r\n'.format(socks_port)) +control_socket.sendall('AUTHENTICATE \r\n'.encode('utf8')) +control_socket.sendall('SETCONF SOCKSPort=0.0.0.0:{}\r\n'.format(socks_port).encode('utf8')) wait_for_log('Opened Socks listener') try_connecting_to_socksport() -control_socket.sendall('SETCONF SOCKSPort=127.0.0.1:{}\r\n'.format(socks_port)) +control_socket.sendall('SETCONF SOCKSPort=127.0.0.1:{}\r\n'.format(socks_port).encode('utf8')) wait_for_log('Opened Socks listener') try_connecting_to_socksport() -control_socket.sendall('SIGNAL HALT\r\n') +control_socket.sendall('SIGNAL HALT\r\n'.encode('utf8')) time.sleep(0.1) print('OK') diff --git a/src/test/test_rebind.sh b/src/test/test_rebind.sh index 47f38afc45..2e18f9c979 100755 --- a/src/test/test_rebind.sh +++ b/src/test/test_rebind.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -x + exitcode=0 "${PYTHON:-python}" "${abs_top_srcdir:-.}/src/test/test_rebind.py" "${TESTING_TOR_BINARY}" || exitcode=1 |