lsmem: implement --summary and more tests
This commit is contained in:
@@ -144,6 +144,41 @@ fn test_split_zones() {
|
||||
sysroot_test_with_args("test_lsmem_split_zones.expected", &["-S", "zones"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_summary_always() {
|
||||
sysroot_test_with_args("test_lsmem_summary_always.expected", &["--summary=always"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_summary_empty() {
|
||||
sysroot_test_with_args("test_lsmem_summary_empty.expected", &["--summary"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_summary_never() {
|
||||
sysroot_test_with_args("test_lsmem_summary_never.expected", &["--summary=never"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_summary_only() {
|
||||
sysroot_test_with_args("test_lsmem_summary_only.expected", &["--summary=only"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_summary_conflict_json() {
|
||||
new_ucmd!().arg("--summary").arg("-J").fails().code_is(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_summary_conflict_pairs() {
|
||||
new_ucmd!().arg("--summary").arg("-P").fails().code_is(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_summary_conflict_raw() {
|
||||
new_ucmd!().arg("--summary").arg("-r").fails().code_is(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_table() {
|
||||
sysroot_test_with_args("test_lsmem_table.expected", &[]);
|
||||
|
7
tests/fixtures/lsmem/test_lsmem_summary_always.expected
vendored
Normal file
7
tests/fixtures/lsmem/test_lsmem_summary_always.expected
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
RANGE SIZE STATE REMOVABLE BLOCK
|
||||
0x0000000000000000-0x0000000037ffffff 896M online yes 0-6
|
||||
0x0000000100000000-0x00000004afffffff 14.8G online yes 32-149
|
||||
|
||||
Memory block size: 128M
|
||||
Total online memory: 15.6G
|
||||
Total offline memory: 0B
|
3
tests/fixtures/lsmem/test_lsmem_summary_empty.expected
vendored
Normal file
3
tests/fixtures/lsmem/test_lsmem_summary_empty.expected
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Memory block size: 128M
|
||||
Total online memory: 15.6G
|
||||
Total offline memory: 0B
|
3
tests/fixtures/lsmem/test_lsmem_summary_never.expected
vendored
Normal file
3
tests/fixtures/lsmem/test_lsmem_summary_never.expected
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
RANGE SIZE STATE REMOVABLE BLOCK
|
||||
0x0000000000000000-0x0000000037ffffff 896M online yes 0-6
|
||||
0x0000000100000000-0x00000004afffffff 14.8G online yes 32-149
|
3
tests/fixtures/lsmem/test_lsmem_summary_only.expected
vendored
Normal file
3
tests/fixtures/lsmem/test_lsmem_summary_only.expected
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Memory block size: 128M
|
||||
Total online memory: 15.6G
|
||||
Total offline memory: 0B
|
Reference in New Issue
Block a user