tests/dmesg: create test for --kmsg-file and --json option.

This commit is contained in:
Fuad Ismail
2024-11-14 22:50:36 +07:00
parent 44d942da4d
commit 7c5caf69ab
4 changed files with 670 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
// This file is part of the uutils coreutils package.
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
}
#[test]
fn test_kmsg_json() {
new_ucmd!()
.arg("--kmsg-file")
.arg("kmsg.input")
.arg("--json")
.run()
.no_stderr()
.stdout_is_fixture("test_kmsg_json.expected");
}
BIN
View File
Binary file not shown.
File diff suppressed because it is too large Load Diff
+4
View File
@@ -32,3 +32,7 @@ mod test_setsid;
#[cfg(feature = "last")]
#[path = "by-util/test_last.rs"]
mod test_last;
#[cfg(feature = "dmesg")]
#[path = "by-util/test_dmesg.rs"]
mod test_dmesg;