summaryrefslogtreecommitdiff
path: root/test/selfmount.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/selfmount.py')
-rw-r--r--test/selfmount.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/selfmount.py b/test/selfmount.py
index ddfb77dc..57dfffa8 100644
--- a/test/selfmount.py
+++ b/test/selfmount.py
@@ -182,6 +182,20 @@ def run(binary):
log = client.read('/log').decode()
check(log.count('over 1 MiB') == 1 and 'unknown control message' not in log and 'after-long' in log,
'a 1.1 MiB line is refused once, its tail never a line, the next line runs')
+ # `pardes -` by hand through the mount: the directory, then a
+ # program's output, escapes and all, on one open of /pager; the
+ # +Pager reads back the plain text.
+ got = run(f"{{ pwd; printf '\\033[31mred\\033[m\\n'; }} > {mount}/pager\n".encode())
+ rows = [row.rsplit(maxsplit=1)[0].split(maxsplit=3) for row in client.read('/index').decode().splitlines()]
+ paged = [row[0] for row in rows if len(row) == 4 and row[3].endswith('/+Pager')]
+ check(got == '0' and len(paged) == 1, f'a +Pager made through the mount ({got!r}, {paged!r})')
+ if paged:
+ # The text goes in at the open's close, and a mount's close
+ # (FUSE's release) comes after close(2) has returned.
+ deadline = time.monotonic() + 5
+ while (said := client.read(f'/pane/{paged[0]}/body')) != b'red\n' and time.monotonic() < deadline:
+ time.sleep(.05)
+ check(said == b'red\n', f'its body is the plain text ({said!r})')
# Forty event reads held through the mount, a follower each, and
# the mount still answers the rest: 9ns keeps workers past what
# the editor holds (128), so `cat layout` is not queued behind