diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-11-10 07:51:00 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-11-10 07:52:35 +0900 |
| commit | bb92e3ada9ddbf315a50f2ec4b8bdafb05df7d3d (patch) | |
| tree | 3ee95671cddf1b9a3c40f668d81eab992d03047f /test/test.py | |
| parent | fad419c2a2be3f05ba85370e26341c0adaba05d1 (diff) | |
cmd/hakurei: expose current instance identifier
This writes the 16-byte instance identifier to file descriptor specified by --identifier-fd if set, and closes the file.
This enables safely obtaining the new instance's identifier.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/test.py')
| -rw-r--r-- | test/test.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test.py b/test/test.py index 1d172d96..30b4ac52 100644 --- a/test/test.py +++ b/test/test.py @@ -172,6 +172,11 @@ machine.send_chars("exit\n") machine.wait_for_file("/tmp/p0-exit-ok", timeout=15) machine.fail("getfacl --absolute-names --omit-header --numeric /run/user/1000 | grep 10000") +# Check invalid identifier fd behaviour: +machine.fail('echo \'{"container":{"shell":"/proc/nonexistent","home":"/proc/nonexistent","path":"/proc/nonexistent"}}\' | sudo -u alice -i hakurei -v app --identifier-fd 32767 - 2>&1 | tee > /tmp/invalid-identifier-fd') +machine.wait_for_file("/tmp/invalid-identifier-fd") +print(machine.succeed('grep "^hakurei: cannot write identifier: bad file descriptor$" /tmp/invalid-identifier-fd')) + # Check interrupt shim behaviour: swaymsg("exec sh -c 'ne-foot; echo -n $? > /tmp/monitor-exit-code'") wait_for_window(f"u0_a{hakurei_identity(0)}@machine") |
