tests/dmesg: add kmsg-file option with nonexistent file test.

This commit is contained in:
Fuad Ismail 2024-11-17 09:56:01 +07:00
parent 395c634c0c
commit ac6caf17e3

@ -9,6 +9,17 @@ fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
}
#[test]
fn test_kmsg_nonexistent_file() {
new_ucmd!()
.arg("--kmsg-file")
.arg("definitely-nonexistent-file")
.fails()
.code_is(1)
.no_stdout()
.stderr_is("dmesg: cannot open definitely-nonexistent-file: No such file or directory\n");
}
#[test]
fn test_kmsg_json() {
new_ucmd!()