users: Avoid > /dev/full panic

This commit is contained in:
oech3
2026-01-12 17:13:08 +09:00
committed by oech3
parent 7b5cdc8552
commit 97f8a08ddd
2 changed files with 17 additions and 1 deletions
+15
View File
@@ -6,6 +6,21 @@ use uutests::new_ucmd;
#[cfg(any(target_vendor = "apple", target_os = "linux"))]
use uutests::{util::TestScenario, util_name};
#[ignore = "does not work as same as users > /dev/full"]
#[test]
#[cfg(target_os = "linux")]
fn test_full_panic() {
let full = std::fs::OpenOptions::new()
.write(true)
.open("/dev/full")
.unwrap();
new_ucmd!()
.set_stdout(full)
.fails()
.stderr_contains("No space");
}
#[test]
fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails_with_code(1);