From a2a375d0ddf67a5847f714cf3e9ca019aa64a18e Mon Sep 17 00:00:00 2001 From: Ulrich Hornung Date: Tue, 12 Mar 2024 19:05:51 +0100 Subject: [PATCH] using other than TERM/KILL signal to see if --preserve-status works --- tests/by-util/test_timeout.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/by-util/test_timeout.rs b/tests/by-util/test_timeout.rs index 6c4a00eb5..f46cb0fec 100644 --- a/tests/by-util/test_timeout.rs +++ b/tests/by-util/test_timeout.rs @@ -93,6 +93,18 @@ fn test_preserve_status() { .no_stdout(); } +#[test] +fn test_preserve_status_even_when_send_signal() { + // When sending CONT signal, process doesn't get killed or stopped. + // So, expected result is success and code 0. + new_ucmd!() + .args(&["-s", "CONT", "--preserve-status", ".1", "sleep", "5"]) + .succeeds() + .code_is(0) + .no_stderr() + .no_stdout(); +} + #[test] fn test_dont_overflow() { new_ucmd!()