Commit db1204c7 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

TEST: Update test script. Not a proper test yet

parent 5f8ec497
......@@ -7,17 +7,16 @@ import socketio
import textwrap as tw
def main():
server_url = sys.argv[1]
infile = sys.argv[2]
sio = socketio.Client()
sio.connect(server_url)
sio = socketio.Client(logger=True,
engineio_logger=True)
def on_connect():
print(f'Connected - sending input file')
print('Connected - sending input file')
sio.emit('input', {'filename' : infile})
def on_output(data):
......@@ -30,23 +29,21 @@ def main():
print(' ', data['command'])
def on_finished(data):
sio.disconnect()
print('Received finished event')
print(' code: ', data['exitcode'])
print(' stdout:')
print(tw.indent(data['stdout'], ' '))
print(' stderr:')
print(tw.indent(data['stderr'], ' '))
print(' exit code: ', data['exitcode'])
print(' total time:', data['totaltime'])
sio.emit('shutdown', {})
sio.disconnect()
sio.on('connect', on_connect)
sio.on('output', on_output)
sio.on('command', on_command)
sio.on('finished', on_finished)
sio.on('success', on_finished)
sio.on('error', on_finished)
sio.connect(server_url)
sio.wait()
if __name__ == '__main__':
sys.exit(main())
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment