From: Christian Goeschel Ndjomouo Date: Fri, 23 Jan 2026 19:12:33 +0000 (-0500) Subject: tests: (lsns) use long options to improve test coverage report X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f33a395cde312ff9377570a21341922e2fa4891;p=thirdparty%2Futil-linux.git tests: (lsns) use long options to improve test coverage report Signed-off-by: Christian Goeschel Ndjomouo --- diff --git a/tests/ts/lsns/filedesc b/tests/ts/lsns/filedesc index 9a3642162..40eac7d41 100755 --- a/tests/ts/lsns/filedesc +++ b/tests/ts/lsns/filedesc @@ -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 diff --git a/tests/ts/lsns/ioctl_ns b/tests/ts/lsns/ioctl_ns index c9cd31f7c..c4b1f2db5 100755 --- a/tests/ts/lsns/ioctl_ns +++ b/tests/ts/lsns/ioctl_ns @@ -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 diff --git a/tests/ts/lsns/netns-from-sock b/tests/ts/lsns/netns-from-sock index f4249a8a6..051167f73 100755 --- a/tests/ts/lsns/netns-from-sock +++ b/tests/ts/lsns/netns-from-sock @@ -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 diff --git a/tests/ts/lsns/netnsid b/tests/ts/lsns/netnsid index 62e6a9666..19f01f614 100755 --- a/tests/ts/lsns/netnsid +++ b/tests/ts/lsns/netnsid @@ -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 diff --git a/tests/ts/lsns/netnsid-for-persistent-namespaces b/tests/ts/lsns/netnsid-for-persistent-namespaces index 232fd6fc4..6c3cf59cf 100755 --- a/tests/ts/lsns/netnsid-for-persistent-namespaces +++ b/tests/ts/lsns/netnsid-for-persistent-namespaces @@ -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