summaryrefslogtreecommitdiff
path: root/test/fs_soak.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs_soak.py')
-rw-r--r--test/fs_soak.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/test/fs_soak.py b/test/fs_soak.py
index 1201fda2..5569a7c7 100644
--- a/test/fs_soak.py
+++ b/test/fs_soak.py
@@ -56,7 +56,7 @@ def read_fid(client, fid, limit, count):
def check_body(client, pane, count=4096):
- fid = client.open(f'/self/pane/{pane["serial"]}/body')
+ fid = client.open(f'/pane/{pane["serial"]}/body')
try:
actual = read_fid(client, fid, BODY_LIMIT, count)
finally:
@@ -127,7 +127,7 @@ def run(args):
address = unix_address
if args.transport == 'tcp':
listeners = [line.split('!') for line in
- control.read('/self/listeners').decode().splitlines()
+ control.read('/listeners').decode().splitlines()
if line.startswith('tcp!')]
assert len(listeners) == 1, listeners
transport, host, port = listeners[0]
@@ -140,11 +140,12 @@ def run(args):
for slot in range(4):
body = payload(rng)
serial = 1 if slot == 0 else new_pane(client, body)
- base = f'/self/pane/{serial}'
+ base = f'/pane/{serial}'
if slot == 0:
client.write(base + '/body', body, truncate=True)
path = root / f'pane-{slot}-0.zig'
- client.write(base + '/ctl', f'name {path}\nput\n'.encode())
+ client.write(base + '/name', f'{path}\n'.encode())
+ client.write(base + '/ctl', b'exec Save\n')
panes.append({'serial': serial, 'body': body, 'path': path, 'variant': 0})
emit(kind='start', seed=args.seed, session_pid=pid,
transport=args.transport, host='tty' if args.tty else 'detached',
@@ -161,7 +162,7 @@ def run(args):
for operation in operations:
slot = rng.randrange(len(panes))
pane = panes[slot]
- base = f'/self/pane/{pane["serial"]}'
+ base = f'/pane/{pane["serial"]}'
if operation == 'append':
addition = payload(rng, min(256, BODY_LIMIT - len(pane['body'])))
client.write(base + '/body', addition)
@@ -185,7 +186,8 @@ def run(args):
elif operation == 'save':
pane['variant'] ^= 1
pane['path'] = root / f'pane-{slot}-{pane["variant"]}.zig'
- client.write(base + '/ctl', f'name {pane["path"]}\nput\n'.encode())
+ client.write(base + '/name', f'{pane["path"]}\n'.encode())
+ client.write(base + '/ctl', b'exec Save\n')
check_bytes(pane['path'].read_bytes(), pane['body'], 'saved file')
check_bytes(client.read('/os' + str(pane['path'])), pane['body'], 'OS mount')
elif operation == 'reload':
@@ -194,19 +196,20 @@ def run(args):
client.write(base + '/ctl', b'get\n')
elif operation == 'cycle':
old_serial = pane['serial']
- client.write(base + '/ctl', b'delete\n')
+ client.write(base + '/ctl', b'exec Del\n')
pane['body'] = payload(rng)
pane['serial'] = new_pane(client, pane['body'])
assert pane['serial'] != old_serial
- base = f'/self/pane/{pane["serial"]}'
- client.write(base + '/ctl', f'name {pane["path"]}\nput\n'.encode())
+ base = f'/pane/{pane["serial"]}'
+ client.write(base + '/name', f'{pane["path"]}\n'.encode())
+ client.write(base + '/ctl', b'exec Save\n')
elif operation == 'reconnect':
client.socket.close()
client = Client(address)
check_session(client, control, pid)
check_body(control, pane)
elif operation == 'screen':
- frozen = client.open('/self/screen')
+ frozen = client.open('/screen')
try:
before = read_fid(client, frozen, SCREEN_LIMIT, 4096)
check_screen(before)
@@ -217,7 +220,7 @@ def run(args):
check_bytes(after, before, 'frozen screen')
finally:
client.close(frozen)
- fresh = client.open('/self/screen')
+ fresh = client.open('/screen')
try:
check_screen(read_fid(client, fresh, SCREEN_LIMIT, 4096))
finally:
@@ -225,8 +228,8 @@ def run(args):
operation_count += 1
check_body(client, pane)
expected = {str(pane['serial']) for pane in panes}
- assert set(client.list('/self/pane')) == expected
- assert set(control.list('/self/pane')) == expected
+ assert set(client.list('/pane')) == expected
+ assert set(control.list('/pane')) == expected
for pane in panes:
check_body(client, pane)
check_body(control, pane)