From 2a754a004b88f467772793cdef53effc1e2f4b4a Mon Sep 17 00:00:00 2001 From: Christian Goeschel Ndjomouo Date: Wed, 21 Jan 2026 22:36:51 -0500 Subject: [PATCH] tests: (lsmem) use long options to improve test coverage report Signed-off-by: Christian Goeschel Ndjomouo --- tests/expected/lsmem/lsmem-s390-zvm-6g | 22 ++++++++++++++ tests/expected/lsmem/lsmem-x86_64-16g | 40 ++++++++++++++++++++++++++ tests/ts/lsmem/lsmem | 37 ++++++++++++------------ 3 files changed, 81 insertions(+), 18 deletions(-) diff --git a/tests/expected/lsmem/lsmem-s390-zvm-6g b/tests/expected/lsmem/lsmem-s390-zvm-6g index 4fcdc718c..fe3892f6e 100644 --- a/tests/expected/lsmem/lsmem-s390-zvm-6g +++ b/tests/expected/lsmem/lsmem-s390-zvm-6g @@ -224,6 +224,28 @@ Memmap on memory parameter: no --- +$ lsmem --output-all +RANGE SIZE STATE REMOVABLE BLOCK NODE ZONES +0x0000000000000000-0x000000006fffffff 1.8G online yes 0-6 0 DMA +0x0000000070000000-0x000000007fffffff 256M online no 7 0 DMA/Normal +0x0000000080000000-0x000000009fffffff 512M online yes 8-9 0 Normal +0x00000000a0000000-0x00000000bfffffff 512M online no 10-11 0 Normal +0x00000000c0000000-0x00000000dfffffff 512M online yes 12-13 0 Normal +0x00000000e0000000-0x00000000efffffff 256M offline 14 0 Normal +0x00000000f0000000-0x00000000ffffffff 256M online yes 15 0 Normal +0x0000000100000000-0x000000010fffffff 256M online no 16 0 Normal +0x0000000110000000-0x000000011fffffff 256M online no 17 0 Normal/Movable +0x0000000120000000-0x000000012fffffff 256M online yes 18 0 Movable/Normal +0x0000000130000000-0x000000013fffffff 256M online yes 19 0 Movable +0x0000000140000000-0x000000017fffffff 1G offline 20-23 0 Movable + +Memory block size: 256M +Total online memory: 4.8G +Total offline memory: 1.3G +Memmap on memory parameter: no + +--- + $ lsmem RANGE SIZE STATE REMOVABLE BLOCK 0x0000000000000000-0x000000006fffffff 1.8G online yes 0-6 diff --git a/tests/expected/lsmem/lsmem-x86_64-16g b/tests/expected/lsmem/lsmem-x86_64-16g index 955ad9581..d3232470c 100644 --- a/tests/expected/lsmem/lsmem-x86_64-16g +++ b/tests/expected/lsmem/lsmem-x86_64-16g @@ -527,6 +527,46 @@ Memmap on memory parameter: no --- +$ lsmem --output-all +RANGE SIZE STATE REMOVABLE BLOCK NODE ZONES +0x0000000000000000-0x0000000007ffffff 128M online no 0 0 None +0x0000000008000000-0x0000000037ffffff 768M online yes 1-6 0 DMA32 +0x0000000038000000-0x000000003fffffff 128M online no 7 0 DMA32 +0x0000000040000000-0x0000000077ffffff 896M online yes 8-14 0 DMA32 +0x0000000078000000-0x000000007fffffff 128M online no 15 0 DMA32 +0x0000000080000000-0x00000000afffffff 768M online yes 16-21 0 DMA32 +0x00000000b0000000-0x00000000bfffffff 256M online no 22-23 0 DMA32 +0x0000000100000000-0x00000001a7ffffff 2.6G online no 32-52 0 Normal +0x00000001a8000000-0x00000001afffffff 128M online yes 53 0 Normal +0x00000001b0000000-0x00000001bfffffff 256M online no 54-55 0 Normal +0x00000001c0000000-0x00000001ffffffff 1G online yes 56-63 0 Normal +0x0000000200000000-0x0000000207ffffff 128M online no 64 0 Normal +0x0000000208000000-0x000000021fffffff 384M online yes 65-67 0 Normal +0x0000000220000000-0x0000000237ffffff 384M online no 68-70 0 Normal +0x0000000238000000-0x0000000277ffffff 1G online yes 71-78 0 Normal +0x0000000278000000-0x000000028fffffff 384M online no 79-81 0 Normal +0x0000000290000000-0x0000000297ffffff 128M online yes 82 0 Normal +0x0000000298000000-0x00000002a7ffffff 256M online no 83-84 0 Normal +0x00000002a8000000-0x00000002c7ffffff 512M online yes 85-88 0 Normal +0x00000002c8000000-0x00000002dfffffff 384M online no 89-91 0 Normal +0x00000002e0000000-0x00000002efffffff 256M online yes 92-93 0 Normal +0x00000002f0000000-0x000000034fffffff 1.5G online no 94-105 0 Normal +0x0000000350000000-0x0000000357ffffff 128M online yes 106 0 Normal +0x0000000358000000-0x000000036fffffff 384M online no 107-109 0 Normal +0x0000000370000000-0x0000000377ffffff 128M online yes 110 0 Normal +0x0000000378000000-0x00000003c7ffffff 1.3G online no 111-120 0 Normal +0x00000003c8000000-0x00000003e7ffffff 512M online yes 121-124 0 Normal +0x00000003e8000000-0x000000042fffffff 1.1G online no 125-133 0 Normal +0x0000000430000000-0x0000000437ffffff 128M online yes 134 0 Normal +0x0000000438000000-0x000000043fffffff 128M online no 135 0 None + +Memory block size: 128M +Total online memory: 16G +Total offline memory: 0B +Memmap on memory parameter: no + +--- + $ lsmem RANGE SIZE STATE REMOVABLE BLOCK 0x0000000000000000-0x0000000007ffffff 128M online no 0 diff --git a/tests/ts/lsmem/lsmem b/tests/ts/lsmem/lsmem index 8654ae3d8..179f0ef15 100755 --- a/tests/ts/lsmem/lsmem +++ b/tests/ts/lsmem/lsmem @@ -28,33 +28,34 @@ LSCOLUMNS="RANGE,SIZE,STATE,REMOVABLE,BLOCK,NODE,ZONES" function do_lsmem { - local opts="$*" + local opts="$*" - echo -e "\n---\n" >>${TS_OUTPUT} - echo "\$ lsmem $opts" >>${TS_OUTPUT} - ${TS_CMD_LSMEM} $opts --sysroot "${dumpdir}/${name}" >> $TS_OUTPUT 2>> $TS_ERRLOG + echo -e "\n---\n" >>${TS_OUTPUT} + echo "\$ lsmem $opts" >>${TS_OUTPUT} + ${TS_CMD_LSMEM} $opts --sysroot "${dumpdir}/${name}" >> $TS_OUTPUT 2>> $TS_ERRLOG } for dump in $(ls $TS_SELF/dumps/*.tar.bz2 | sort); do - name=$(basename $dump .tar.bz2) - dumpdir="$TS_OUTDIR/dumps" + name=$(basename $dump .tar.bz2) + dumpdir="$TS_OUTDIR/dumps" - ts_init_subtest $name - mkdir -p $dumpdir + ts_init_subtest $name + mkdir -p $dumpdir - tar -C $dumpdir -jxf $dump + tar -C $dumpdir -jxf $dump - do_lsmem --split=STATE,REMOVABLE - do_lsmem --output RANGE,SIZE --split none - do_lsmem --output RANGE,SIZE,STATE --split STATE - do_lsmem --all --output $LSCOLUMNS - do_lsmem --raw --output $LSCOLUMNS --split $LSCOLUMNS - do_lsmem --json --output $LSCOLUMNS --split $LSCOLUMNS - do_lsmem -o +ZONES - do_lsmem + do_lsmem --split=STATE,REMOVABLE + do_lsmem --output RANGE,SIZE --split none + do_lsmem --output RANGE,SIZE,STATE --split STATE + do_lsmem --all --output $LSCOLUMNS + do_lsmem --raw --output $LSCOLUMNS --split $LSCOLUMNS + do_lsmem --json --output $LSCOLUMNS --split $LSCOLUMNS + do_lsmem -o +ZONES + do_lsmem --output-all + do_lsmem - ts_finalize_subtest + ts_finalize_subtest done ts_finalize -- 2.47.3