diff --git a/tests/by-util/test_cksum.rs b/tests/by-util/test_cksum.rs index 7998ae13d8f..3a208fb1943 100644 --- a/tests/by-util/test_cksum.rs +++ b/tests/by-util/test_cksum.rs @@ -3423,3 +3423,20 @@ fn test_check_blake3_untagged( .succeeds() .stdout_only("FILE: OK\n"); } + +// Regression test: cksum should handle write errors to /dev/full without aborting. +#[test] +#[cfg(target_os = "linux")] +fn test_write_error_dev_full() { + use std::fs::OpenOptions; + let dev_full = OpenOptions::new() + .write(true) + .open("/dev/full") + .expect("Failed to open /dev/full - test must run on Linux"); + + new_ucmd!() + .arg("/dev/null") + .set_stdout(dev_full) + .fails() + .code_is(1); +}