]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add ts_finalize_subtest before continue in loops
authorKarel Zak <kzak@redhat.com>
Wed, 6 May 2026 11:28:16 +0000 (13:28 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 11 May 2026 09:06:04 +0000 (11:06 +0200)
In loops where ts_skip_subtest is called before continue,
add ts_finalize_subtest to properly close the subtest block
before skipping to the next iteration.

Signed-off-by: Karel Zak <kzak@redhat.com>
tests/ts/lsfd/column-ainodeclass
tests/ts/lsfd/column-name
tests/ts/lsfd/column-type
tests/ts/lsfd/column-xmode
tests/ts/lsfd/mkfds-multiplexing
tests/ts/lsfd/mkfds-unix-in-netns

index e95c91d78c228e2750fa678763c0136aad9159d7..e2f71323b5bce9f1d864d165d17c7ccd8da6bc27 100755 (executable)
@@ -48,12 +48,14 @@ for C in pidfd inotify; do
 
     if [ "$C-$RC" == "pidfd-$TS_EXIT_NOTSUPP" ]; then
        ts_skip_subtest "pidfd_open(2) is not available"
+       ts_finalize_subtest
        continue
     fi
 
     STTYPE="$(head -n1 "$TS_OUTPUT" | awk '{print $2}')"
     if [ "$C-$STTYPE" == "pidfd-REG" ]; then
        ts_skip_subtest "pidfd is from pidfs instead of anon inode"
+       ts_finalize_subtest
        continue
     fi
 
index 572d8e8a54866898eca77bd916f475bc0bfb71fd..691895f0e82a2b73646b140114b77e29d0897555 100755 (executable)
@@ -70,6 +70,7 @@ for C in ro-regular-file pidfd socketpair; do
 
     if [ "$C-$RC" == "pidfd-$TS_EXIT_NOTSUPP" ]; then
        ts_skip_subtest "pidfd_open(2) is not available"
+       ts_finalize_subtest
        continue
     fi
 
index b0bdfc25e3f57353d9902b5416d9d7e12e14a023..225071a674072898d4ca2dcb64439c97a2bd8f95 100755 (executable)
@@ -56,6 +56,7 @@ for C in ro-regular-file pidfd inotify socketpair; do
 
     if [ "$C-$RC" == "pidfd-$TS_EXIT_NOTSUPP" ]; then
        ts_skip_subtest "pidfd_open(2) is not available"
+       ts_finalize_subtest
        continue
     fi
 
index e616687298b4cce144c3b43773ede2c3e50f8f80..41a30f58b1f4d565335e9bad02a9dae134a31a1c 100755 (executable)
@@ -151,6 +151,7 @@ for m in flock-sh posix-r- ofd-r-; do
     RC=$?
     if [ "$RC" == "$TS_EXIT_NOTSUPP" ]; then
        ts_skip_subtest "$m lock is not available"
+       ts_finalize_subtest
        continue
     fi
     ts_finalize_subtest
@@ -187,6 +188,7 @@ for m in flock-ex posix--w posix-rw  ofd--w ofd-rw lease-w; do
     RC=$?
     if [ "$RC" == "$TS_EXIT_NOTSUPP" ]; then
        ts_skip_subtest "$m lock is not available"
+       ts_finalize_subtest
        continue
     fi
     ts_finalize_subtest
index 2b5795d61d9b27b86831ca48222af3cb4cdace1c..7fcd932a910db88b3f27df37f4cc9fc2b248cbdb 100755 (executable)
@@ -38,6 +38,7 @@ for multiplexer in pselect6 select poll ppoll; do
     ts_init_subtest "${multiplexer}"
     if ! "$TS_HELPER_MKFDS" -W | grep -q "^$multiplexer\$"; then
        ts_skip_subtest "the multiplexer ${multiplexer} is not available"
+       ts_finalize_subtest
        continue
     fi
 
@@ -52,6 +53,7 @@ for multiplexer in pselect6 select poll ppoll; do
            kill -CONT "${PID}"
            wait "${MKFDS_PID}"
            ts_skip_subtest "cannot open /proc/${PID}/syscall"
+           ts_finalize_subtest
            continue
        fi
        syscall_n=$(cut -f1 -d' ' <<< "$syscall_line")
@@ -61,6 +63,7 @@ for multiplexer in pselect6 select poll ppoll; do
            kill -CONT "${PID}"
            wait "${MKFDS_PID}"
            ts_skip_subtest "incorrect syscall number in /proc/${PID}/syscall"
+           ts_finalize_subtest
            continue
        fi
 
index 5f1e070464c1e8f91b0331e750027169cc3367b1..8f25c5cb656bafeefb85b54f2292f04325ab7b42 100755 (executable)
@@ -103,6 +103,7 @@ for t in stream dgram seqpacket; do
     } > "$TS_OUTPUT" 2>&1
     if [ "$RC" == "$EPERM" ]; then
        ts_skip_subtest "unshare(2) is not permitted on this platform"
+       ts_finalize_subtest
        continue
     fi
     ts_finalize_subtest