fix python 3 tests
This commit is contained in:
parent
53d1bfaecf
commit
b409c18877
2 changed files with 2 additions and 18 deletions
|
@ -22,11 +22,6 @@ elif sys.argv[-2] == '-c':
|
||||||
else:
|
else:
|
||||||
raise Exception('usage: test.py -c server_conf [client_conf]')
|
raise Exception('usage: test.py -c server_conf [client_conf]')
|
||||||
|
|
||||||
if 'salsa20' in sys.argv[-1]:
|
|
||||||
from shadowsocks.crypto import salsa20_ctr
|
|
||||||
salsa20_ctr.test()
|
|
||||||
print('encryption test passed')
|
|
||||||
|
|
||||||
p1 = Popen(['python', 'shadowsocks/server.py', '-c', server_config],
|
p1 = Popen(['python', 'shadowsocks/server.py', '-c', server_config],
|
||||||
stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
|
stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
|
||||||
p2 = Popen(['python', 'shadowsocks/local.py', '-c', client_config],
|
p2 = Popen(['python', 'shadowsocks/local.py', '-c', client_config],
|
||||||
|
@ -44,6 +39,8 @@ try:
|
||||||
|
|
||||||
for fd in r:
|
for fd in r:
|
||||||
line = fd.readline()
|
line = fd.readline()
|
||||||
|
if bytes != str:
|
||||||
|
line = str(line, 'utf8')
|
||||||
sys.stdout.write(line)
|
sys.stdout.write(line)
|
||||||
if line.find('starting local') >= 0:
|
if line.find('starting local') >= 0:
|
||||||
local_ready = True
|
local_ready = True
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
before = time.time()
|
|
||||||
|
|
||||||
for line in sys.stdin:
|
|
||||||
if 'HTTP/1.1 ' in line:
|
|
||||||
diff = time.time() - before
|
|
||||||
print 'headline %dms' % (diff * 1000)
|
|
Loading…
Add table
Add a link
Reference in a new issue