aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sandbox/test.py
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-11 07:18:43 +0900
committerOphestra <cat@gensokyo.uk>2025-11-11 07:31:58 +0900
commit9dec9dbc4bbd09a59cf35f4000d26794b42edcfc (patch)
tree760bbf0d62666b590a6ee45324685adac358de32 /test/sandbox/test.py
parent2f74adc8bdeda2499be0a8b2711f68c342695bf2 (diff)
container/init: close setup pipe early
This prevents leaking the setup pipe. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/sandbox/test.py')
-rw-r--r--test/sandbox/test.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/sandbox/test.py b/test/sandbox/test.py
index bce493b4..24fd1d3a 100644
--- a/test/sandbox/test.py
+++ b/test/sandbox/test.py
@@ -45,6 +45,12 @@ machine.wait_for_file("/tmp/sway-ipc.sock")
swaymsg("exec hakurei run cat")
check_filter(0, "pdlike", "cat")
+# Check fd leak:
+swaymsg("exec hakurei -v run sleep infinity")
+pd_identity0_sleep_pid = int(machine.wait_until_succeeds("pgrep -U 10000 -x sleep", timeout=60))
+print(machine.succeed(f"hakurei-test fd {pd_identity0_sleep_pid}"))
+machine.succeed(f"kill -INT {pd_identity0_sleep_pid}")
+
# Verify capabilities/securebits in user namespace:
print(machine.succeed("sudo -u alice -i hakurei run capsh --print"))
print(machine.succeed("sudo -u alice -i hakurei run capsh --has-no-new-privs"))