summaryrefslogtreecommitdiff
path: root/test/v9fs.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-30 17:35:06 -0300
committerGabriel Schneider <[email protected]>2026-10-30 17:35:06 -0300
commit6d8da8721141284cf33bb901168b26135893eb86 (patch)
tree791d63401d4e85fbca1d597a8ce0326e70efd545 /test/v9fs.py
parentefd43a3a2cf03bb741366331158b368abf9ac583 (diff)
parentbf6810a8f9d6cc82050e7d9c0cfb06358301b574 (diff)
downloadpardes-6d8da8721141284cf33bb901168b26135893eb86.tar.gz
pardes-6d8da8721141284cf33bb901168b26135893eb86.zip
Merge latest upstream into the macOS branch for Zig 0.17
Retain the macOS branch history and local Acme selection color while adopting upstream's current core and platform changes. Pin Zig and ZLS to 0.17.0, and fetch the existing zstbi compatibility commit through upstream after its original fork was removed.
Diffstat (limited to 'test/v9fs.py')
-rw-r--r--test/v9fs.py32
1 files changed, 23 insertions, 9 deletions
diff --git a/test/v9fs.py b/test/v9fs.py
index 16916d0b..30efe9fb 100644
--- a/test/v9fs.py
+++ b/test/v9fs.py
@@ -43,8 +43,9 @@ def worker(mountpoint, socket, uid, gid, original_namespace):
assert not any(field.startswith(('shared:', 'master:')) for field in mounted[0].split()[6:])
tree = mountpoint
- assert {'os', 'index', 'pane', 'new', 'ctl', 'log', 'screen', 'README'} <= set(os.listdir(tree))
- assert 'self' not in os.listdir(tree)
+ assert {'os', 'index', 'pane', 'status', 'look', 'exec', 'log', 'screen', 'README'} <= set(os.listdir(tree))
+ assert 'self' not in os.listdir(tree) and 'new' not in os.listdir(tree)
+ assert 'new' not in os.listdir(tree / 'pane'), 'a listing would make a pane per stat'
# A direct connection provides independent evidence for VFS reads/writes.
with Client(socket) as client:
assert (tree / 'index').read_bytes() == client.read('/index')
@@ -52,14 +53,27 @@ def worker(mountpoint, socket, uid, gid, original_namespace):
before = client.read('/index')
subprocess.run(['ls', '-l', str(tree), str(tree / 'pane' / '1')], check=True, capture_output=True, timeout=5)
- subprocess.run(['find', str(tree / 'pane'), str(tree / 'new'), '-ls'], check=True, capture_output=True, timeout=5)
+ subprocess.run(['find', str(tree / 'pane'), '-ls'], check=True, capture_output=True, timeout=5)
assert (tree / 'README').read_bytes() == client.read('/README')
- assert (tree / 'new').stat().st_size == 0
assert client.read('/index') == before, 'browsing created panes'
- serial = int((tree / 'new').read_bytes().split()[0])
- another = int((tree / 'new').read_bytes().split()[0])
- assert serial != another, 'cached factory reused a pane'
- client.write(f'/pane/{another}/ctl', b'exec Del\n')
+ # Opening pane/new makes a pane and the read names it, so no trip
+ # through the index. Whether a repeated path reaches the server at all
+ # is the kernel's dentry cache's business, so the second pane comes
+ # over the wire, where the open is exact.
+ def serials():
+ return {int(row.split()[0]) for row in (tree / 'index').read_bytes().splitlines()}
+
+ def mkpane():
+ known = serials()
+ made = int((tree / 'pane' / 'new').read_bytes())
+ assert made not in known, 'the open of new made no pane'
+ return made
+
+ serial = mkpane()
+ another = int(client.read('/pane/new'))
+ assert serial != another, 'a second open of new reused a pane'
+ (tree / 'pane' / str(another)).rmdir()
+ assert another not in serials()
pane = tree / 'pane' / str(serial)
wire = f'/pane/{serial}'
assert str(serial) in os.listdir(tree / 'pane')
@@ -101,7 +115,7 @@ def worker(mountpoint, socket, uid, gid, original_namespace):
# Reading OS files through the exported tree does not recurse through
# the mount: the core still lives in the supervisor's namespace.
assert (mountpoint / 'os' / str(socket.parent).lstrip('/') / 'kernel.txt').read_bytes() == b'initial\n'
- write_existing(pane / 'ctl', b'exec Del\n')
+ (tree / 'pane' / str(serial)).rmdir()
assert serial not in [int(row.split()[0]) for row in (tree / 'index').read_bytes().splitlines()]
print('v9fs: namespace isolation, privilege drop, inherited mount, directory refresh, '