fix test
This commit is contained in:
parent
a38c2a88dc
commit
36d8039288
1 changed files with 9 additions and 11 deletions
20
test.py
20
test.py
|
@ -105,10 +105,14 @@ try:
|
||||||
if ready_count == 2 and p3 is None:
|
if ready_count == 2 and p3 is None:
|
||||||
p3 = Popen(['curl', 'http://www.google.com/', '-v', '-L',
|
p3 = Popen(['curl', 'http://www.google.com/', '-v', '-L',
|
||||||
'--socks5-hostname', '127.0.0.1:1080'], shell=False,
|
'--socks5-hostname', '127.0.0.1:1080'], shell=False,
|
||||||
bufsize=0, stdin=PIPE, stdout=PIPE, stderr=PIPE,
|
bufsize=0, close_fds=True)
|
||||||
close_fds=True)
|
break
|
||||||
fdset.append(p3.stdout)
|
|
||||||
fdset.append(p3.stderr)
|
if p3 is not None:
|
||||||
|
r = p3.wait()
|
||||||
|
if r == 0:
|
||||||
|
print 'test passed'
|
||||||
|
sys.exit(r)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
for p in [p1, p2]:
|
for p in [p1, p2]:
|
||||||
|
@ -116,11 +120,5 @@ finally:
|
||||||
p.kill()
|
p.kill()
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if p3 is not None:
|
|
||||||
r = p3.wait()
|
|
||||||
if r == 0:
|
|
||||||
print 'test passed'
|
|
||||||
sys.exit(r)
|
|
||||||
|
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue