diff options
-rwxr-xr-x | tests/runner.py | 7 | ||||
-rwxr-xr-x | tests/socket_server.sh | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/runner.py b/tests/runner.py index 169d9609..63a0650f 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -8450,14 +8450,14 @@ elif 'browser' in str(sys.argv): class WebsockHarness: def __enter__(self): def server_func(): - os.system('while true; do (/bin/echo -en "te\x01\xff\x79st\x02" ; sleep 1000) | nc -vvvl 127.0.0.1 8990; done;') # sleep to work around websockify issue 63 + subprocess.call([path_from_root('tests', 'socket_server.sh')]); self.server = multiprocessing.Process(target=server_func) self.server.start() print '[Socket server on process %d]' % self.server.pid def websockify_func(): - os.system(path_from_root('third_party', 'websockify', 'other', 'websockify') + ' -vvv 8991 127.0.0.1:8990') + subprocess.call([path_from_root('third_party', 'websockify', 'other', 'websockify'), '-vvv', '8991', '127.0.0.1:8990']) self.websockify = multiprocessing.Process(target=websockify_func) self.websockify.start() @@ -8466,8 +8466,9 @@ elif 'browser' in str(sys.argv): def __exit__(self, *args, **kwargs): for proc in [self.websockify, self.server]: try: - print '[Cleaning up %d]', proc.pid + print '[Cleaning up %d]' % proc.pid proc.terminate() + print '[ok]' finally: pass diff --git a/tests/socket_server.sh b/tests/socket_server.sh new file mode 100755 index 00000000..a8a3aa50 --- /dev/null +++ b/tests/socket_server.sh @@ -0,0 +1,3 @@ +#!/bin/sh +while true; do (/bin/echo -en "te\x01\xff\x79st\x02") | nc -vvvl 127.0.0.1 8990; done; + |