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

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");
}