aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-09-22 21:56:29 +0900
committerOphestra <cat@gensokyo.uk>2025-09-22 21:56:29 +0900
commitf09133a224fabf2d16c7790654e39068cb59450f (patch)
treef053428daf682e14ed231f8a8e48752563ac867f /test
parent16409b37a2de7dbc112e113481a2f2c45f9f09f8 (diff)
test: check init lingering timeout behaviour
This checks init timeout on lingering process after initial process termination. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test')
-rw-r--r--test/configuration.nix24
-rw-r--r--test/test.py9
2 files changed, 33 insertions, 0 deletions
diff --git a/test/configuration.nix b/test/configuration.nix
index b7970dd9..39fd166c 100644
--- a/test/configuration.nix
+++ b/test/configuration.nix
@@ -112,7 +112,31 @@
};
};
+ commonPaths = [
+ {
+ type = "bind";
+ src = "/var/tmp";
+ write = true;
+ }
+ ];
+
apps = {
+ "cat.gensokyo.extern.bash.linger-timeout" = {
+ name = "hakurei-check-linger-timeout";
+ identity = 9999;
+ share = pkgs.bash;
+ packages = [ pkgs.bash ];
+ command = ''
+ sleep infinity & disown
+ exit
+ '';
+ wait_delay = 1;
+ enablements = {
+ wayland = false;
+ pulse = false;
+ };
+ };
+
"cat.gensokyo.extern.foot.noEnablements" = {
name = "ne-foot";
identity = 1;
diff --git a/test/test.py b/test/test.py
index 537b4b16..ae4dfdac 100644
--- a/test/test.py
+++ b/test/test.py
@@ -103,6 +103,15 @@ if denyOutput != "hsu: uid 1001 is not in the hsurc file\n":
if denyOutputVerbose != "hsu: uid 1001 is not in the hsurc file\nhakurei: *cannot obtain uid from setuid wrapper: current user is not in the hsurc file\n":
raise Exception(f"unexpected deny verbose output:\n{denyOutputVerbose}")
+# Verify timeout behaviour:
+machine.succeed('sudo -u alice -i hakurei-check-linger-timeout > /var/tmp/linger-stdout 2> /var/tmp/linger-stderr')
+linger_stdout = machine.succeed("cat /var/tmp/linger-stdout")
+linger_stderr = machine.succeed("cat /var/tmp/linger-stderr")
+if linger_stdout != "":
+ raise Exception(f"unexpected stdout: {linger_stdout}")
+if linger_stderr != "init: timeout exceeded waiting for lingering processes\n":
+ raise Exception(f"unexpected stderr: {linger_stderr}")
+
check_offset = 0