fix test
This commit is contained in:
parent
6e5a753d41
commit
e113479a80
1 changed files with 9 additions and 5 deletions
12
test.py
12
test.py
|
@ -92,7 +92,8 @@ p3 = None
|
|||
print 'encryption test passed'
|
||||
|
||||
try:
|
||||
ready_count = 0
|
||||
local_ready = False
|
||||
server_ready = False
|
||||
fdset = [p1.stdout, p2.stdout, p1.stderr, p2.stderr]
|
||||
while True:
|
||||
r, w, e = select.select(fdset, [], fdset)
|
||||
|
@ -102,10 +103,13 @@ try:
|
|||
for fd in r:
|
||||
line = fd.readline()
|
||||
sys.stdout.write(line)
|
||||
if line.find('starting') >= 0:
|
||||
ready_count += 1
|
||||
if line.find('starting local') >= 0:
|
||||
local_ready = True
|
||||
if line.find('starting server') >= 0:
|
||||
server_ready = True
|
||||
|
||||
if ready_count == 2 and p3 is None:
|
||||
if local_ready and server_ready and p3 is None:
|
||||
time.sleep(1)
|
||||
p3 = Popen(['curl', 'http://www.example.com/', '-v', '-L',
|
||||
'--socks5-hostname', '127.0.0.1:1080'], shell=False,
|
||||
bufsize=0, close_fds=True)
|
||||
|
|
Loading…
Reference in a new issue