1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-14 19:16:17 +00:00

Merge pull request #6382 from BenWiederhake/dev-signal-casing

uucore+timeout: accept signals of any casing
This commit is contained in:
Sylvestre Ledru 2024-07-09 23:18:25 +02:00 committed by GitHub
commit c90b69398f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 12 deletions

View file

@ -97,12 +97,14 @@ fn test_preserve_status() {
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();
for cont_spelling in ["CONT", "cOnT", "SIGcont"] {
new_ucmd!()
.args(&["-s", cont_spelling, "--preserve-status", ".1", "sleep", "2"])
.succeeds()
.code_is(0)
.no_stderr()
.no_stdout();
}
}
#[test]

View file

@ -3193,8 +3193,6 @@ mod tests {
#[cfg(feature = "sleep")]
#[cfg(unix)]
#[rstest]
#[case::signal_full_name_lower_case("sigkill")]
#[case::signal_short_name_lower_case("kill")]
#[case::signal_only_part_of_name("IGKILL")] // spell-checker: disable-line
#[case::signal_just_sig("SIG")]
#[case::signal_value_too_high("100")]
@ -3207,6 +3205,17 @@ mod tests {
result.signal_name_is(signal_name);
}
#[test]
#[cfg(feature = "sleep")]
#[cfg(unix)]
fn test_cmd_result_signal_name_is_accepts_lowercase() {
let mut child = TestScenario::new("sleep").ucmd().arg("60").run_no_wait();
child.kill();
let result = child.wait().unwrap();
result.signal_name_is("sigkill");
result.signal_name_is("kill");
}
#[test]
#[cfg(unix)]
fn test_parse_coreutil_version() {