summaryrefslogtreecommitdiff
path: root/test/fs_soak.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-20 00:36:50 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commitc1990b3e6e196ad41379aa432bf3ccca8a65d9f0 (patch)
treed7ad5afe559f7f56464b14c3122242fa3f16399b /test/fs_soak.py
parent717afaf3177a2e0925b18ae3445119efe808b129 (diff)
downloadpardes-c1990b3e6e196ad41379aa432bf3ccca8a65d9f0.tar.gz
pardes-c1990b3e6e196ad41379aa432bf3ccca8a65d9f0.zip
Flatten the 9P control tree and move it out of fs.zig
The served tree loses the self/ level: /index /ctl /new /log /screen /listeners /pane/<n>/... /os, with /src only in -Dembed-sources=true builds (default off, on for esp32p4). ctl speaks the editor's own language with two lowercase verbs, look TEXT and exec TEXT, plus acme's addr verbs; the new/ factory directory becomes one clone file; cons is gone (exec Msg); name and sel are files; stats report real lengths, modes and mtimes; /log streams pane new/del/rename/save events. The tree code lives in src/ninep/ (tree, pane, ctl, addr, pty, events, screen, sources); fs.zig keeps host access, mounts, resolution and find/grep. Same engine and transports. README (fs-help.txt) and docs rewritten; tests updated and extended. Co-Authored-By: Claude Fable 5.1 <[email protected]>
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)