mirror of
https://github.com/uutils/coreutils.git
synced 2025-07-07 21:45:01 +00:00
timeout: Add test for SIGTERM processing
This is the test for issue #8040.
This commit is contained in:
parent
ec5f6feaa2
commit
baab9aa895
1 changed files with 20 additions and 0 deletions
|
@ -206,3 +206,23 @@ fn test_hex_timeout_ending_with_d() {
|
|||
.fails_with_code(124)
|
||||
.no_output();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_terminate_child_on_receiving_terminate() {
|
||||
let mut timeout_cmd = new_ucmd!()
|
||||
.args(&[
|
||||
"10",
|
||||
"sh",
|
||||
"-c",
|
||||
"trap 'echo child received TERM' TERM; sleep 5",
|
||||
])
|
||||
.run_no_wait();
|
||||
timeout_cmd.delay(100);
|
||||
timeout_cmd.kill_with_custom_signal(nix::sys::signal::Signal::SIGTERM);
|
||||
timeout_cmd
|
||||
.make_assertion()
|
||||
.is_not_alive()
|
||||
.with_current_output()
|
||||
.code_is(143)
|
||||
.stdout_contains("child received TERM");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue