]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (lsns) use long options to improve test coverage report
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Fri, 23 Jan 2026 19:12:33 +0000 (14:12 -0500)
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Fri, 30 Jan 2026 01:08:36 +0000 (20:08 -0500)
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
tests/ts/lsns/filedesc
tests/ts/lsns/ioctl_ns
tests/ts/lsns/netns-from-sock
tests/ts/lsns/netnsid
tests/ts/lsns/netnsid-for-persistent-namespaces

index 9a3642162ac4b98243cb296e537492873ea70275..40eac7d415cdae581f4994006e845d7a4e486836 100755 (executable)
@@ -64,7 +64,7 @@ trap "cleanup" EXIT
        lsfd_expr="PID == ${PID} and FD == $FD"
        lsfd_inode=$(${TS_CMD_LSFD} -n --raw -o INODE -Q "${lsfd_expr}")
        lsns_expr="NS == $lsfd_inode"
-       lsns_output=$(${TS_CMD_LSNS}    -n --raw -o TYPE,NPROCS,USER -Q "${lsns_expr}")
+       lsns_output=$(${TS_CMD_LSNS} --noheadings --raw --output TYPE,NPROCS,USER -Q "${lsns_expr}")
        if ! [ "${lsns_output}" == "net 0 root" ]; then
            echo lsfd_inode: $lsfd_inode
            echo lsns_output: $lsns_output
index c9cd31f7c8880208e564f7df1aa62d28a311a78b..c4b1f2db578a8888f48b875b3b2da6de09dc0607 100755 (executable)
@@ -73,7 +73,7 @@ init
     read child_pidns  < $FIFO_DATA
 
     expected="$child_userns $my_userns $my_userns"
-    actual=$("$TS_CMD_LSNS" -t user -n -o NS,PNS,ONS "$child_userns" | uniq)
+    actual=$("$TS_CMD_LSNS" --type user --noheadings --output NS,PNS,ONS "$child_userns" | uniq)
     test "$expected" = "$actual"
     RESULT=$?
     if [ $RESULT -ne 0 ]; then
index f4249a8a6281116f8d69edf87b400f0fa30deeca..051167f730aa094b92d5e5997f57a2eba8ca946a 100755 (executable)
@@ -58,7 +58,7 @@ NETNS=
        for t in $(for t0 in "${!tcase[@]}"; do echo "$t0"; done | sort); do
            column=$t
            expected=${tcase[$t]}
-           output=$(${TS_CMD_LSNS} -n --raw -o $column -Q "NS == $NETNS")
+           output=$(${TS_CMD_LSNS} --noheadings --raw --output $column --filter "NS == $NETNS")
            echo "$column \$? $?"
 
            if [[ "${output}" == "$expected" ]]; then
index 62e6a96668bd5c9f362c2434a73ffc71eecf16e5..19f01f6147fea73d3c1f6193fa421714f78d519a 100755 (executable)
@@ -82,7 +82,7 @@ fi
        fi
 
        echo "===LSNS output" >> $LOG
-       $TS_CMD_LSNS -o+NETNSID,NSFS --type net >> $LOG
+       $TS_CMD_LSNS --output +NETNSID,NSFS --type net >> $LOG
 
        LSNS_ID=$($TS_CMD_LSNS -n -o NETNSID --type net --task $PID | { read VAL; echo $VAL; } )
        echo "===LSNS_ID=$LSNS_ID" >> $LOG
index 232fd6fc448cc8a3f508b4983a4fad9499021c62..6c3cf59cf0208f76e7986e822bfaeebe0dbd0d89 100755 (executable)
@@ -55,7 +55,7 @@ function netnsid_subtest {
     local O
     
     ts_init_subtest "$1"
-    if O=$($TS_CMD_LSNS --raw --noheadings -Q "NETNSID == '$NETNSID'" -o $1); then
+    if O=$($TS_CMD_LSNS --raw --noheadings --filter "NETNSID == '$NETNSID'" --output $1); then
        if "$eval_func" "$O"; then
            echo OK
        else