diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 09:51:11 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | ad3403adb72e3457eb76d6b3fc91cf8df3d738ae (patch) | |
| tree | 1669efb3e6891b3a32a71c1fcffe8dd48428d9b2 /test/fs.py | |
| parent | 6e2ed2e057ba95b3a86186c255d1965e1861bdf7 (diff) | |
| download | pardes-ad3403adb72e3457eb76d6b3fc91cf8df3d738ae.tar.gz pardes-ad3403adb72e3457eb76d6b3fc91cf8df3d738ae.zip | |
A shell that cannot start fails Tty and pty/ctl exec with why, before either answers
A shell whose exec failed (a script's missing interpreter) was reported
started: Tty and pty/ctl exec succeeded, then the pane died. The child now
reports a failed chdir or exec through a close-on-exec pipe the parent
reads before acknowledging the shell; the host's spawn fails with the
reason (`shell not found`, ENOENT), which fails the waiting write. A Tty
whose first shell never ran leaves no pane; a terminal restarted by
pty/ctl exec keeps its pane.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/fs.py')
| -rw-r--r-- | test/fs.py | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -515,6 +515,28 @@ def new_terminals_named_once(binary): for serial in made: assert f'\nrename {serial} ' not in '\n' + log, (serial, log) assert f'\nnew {serial} {root}' in '\n' + log, (serial, log) + # A shell that cannot start (its interpreter is not there): Tty + # fails the write with why and leaves no pane; pty/ctl exec + # fails with why and keeps its terminal. + bad = root / 'badsh' + bad.write_bytes(b'#!/nonexistent/interp\n') + bad.chmod(0o755) + panes = client.read('/index') + try: + client.write('/pane/1/ctl', f'Tty {bad}\n'.encode()) + raise AssertionError('Tty of a shell that cannot start was taken') + except OSError as refused: + assert 'shell' in str(refused), refused + time.sleep(.3) + assert client.read('/index').count(b'\n') == panes.count(b'\n'), client.read('/index') + client.write('/ctl', f'Shell {bad}\n'.encode()) + try: + client.write(f'/pane/{made[0]}/pty/ctl', b'exec\n') + raise AssertionError('pty/ctl exec of a shell that cannot start was taken') + except OSError as refused: + assert 'shell' in str(refused), refused + client.write('/ctl', b'Shell\n') + assert str(made[0]).encode() in b' '.join(r.split()[0] for r in client.read('/index').splitlines()) def workflow_canary(binary): |
