]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add ts_finalize_subtest before return in functions
authorKarel Zak <kzak@redhat.com>
Wed, 6 May 2026 11:29:49 +0000 (13:29 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 11 May 2026 09:06:04 +0000 (11:06 +0200)
In helper functions that call ts_skip_subtest and then return
early, add ts_finalize_subtest to properly close the subtest
block before returning.

Signed-off-by: Karel Zak <kzak@redhat.com>
tests/ts/chrt/chrt
tests/ts/chrt/chrt-non-root
tests/ts/lsfd/mkfds-socketpair

index f31f54eaf002eda37733d9f4bf1b386b31ee0189..7a195e35d1f1cc2981f3e6cfdb5482df2a8b0dc3 100755 (executable)
@@ -32,6 +32,7 @@ function skip_policy {
        $TS_CMD_CHRT --max | grep $1 | grep 'priority' &> /dev/null
        if [ $? == 1 ]; then
                ts_skip_subtest "unsupported"
+               ts_finalize_subtest
                return 1
        fi
        return 0
@@ -40,6 +41,7 @@ function skip_policy {
 function skip_kernel_lt {
        if ts_kernel_ver_lt $1 $2 $3; then
                ts_skip_subtest "kernel version must be >= $1.$2.$3"
+               ts_finalize_subtest
                return 1
        fi
 
@@ -50,6 +52,7 @@ function skip_kernel_ge {
        ts_kernel_ver_lt $1 $2 $3
        if [ $? == 1 ]; then
                ts_skip_subtest "kernel version must be < $1.$2.$3"
+               ts_finalize_subtest
                return 1
        fi
 
index aa107dc3fef9d7a2fd990b51db731782549dd009..e0a17765f92b54121b0f412c444ced7be8f9dcf0 100755 (executable)
@@ -32,6 +32,7 @@ function skip_policy {
        $TS_CMD_CHRT --max | grep $1 | grep 'priority' &> /dev/null
        if [ $? == 1 ]; then
                ts_skip_subtest "unsupported"
+               ts_finalize_subtest
                return 1
        fi
        return 0
index accf17a26a7c63a1d37b5551e9aef539790b5e1d..95f9b02971f4c8c1e9c40a563c9f0dcc8e39e05c 100755 (executable)
@@ -71,6 +71,7 @@ mkfds_socketpair_stream_endpoint()
     ts_init_subtest "STREAM-ENDPOINT"
     if [ "$QEMU_USER" == "1" ]; then
        ts_skip_subtest "running under qemu-user emulation"
+       ts_finalize_subtest
        return
     fi
     {
@@ -93,6 +94,7 @@ mkfds_socketpair_stream_shutdown_state()
     ts_init_subtest "STREAM-SHUTDOWN-STATE"
     if [ "$QEMU_USER" == "1" ]; then
        ts_skip_subtest "running under qemu-user emulation"
+       ts_finalize_subtest
        return
     fi
     {
@@ -115,6 +117,7 @@ mkfds_socketpair_stream_endpoint_halfclose()
     ts_init_subtest "STREAM-ENDPOINT-halfclose"
     if [ "$QEMU_USER" == "1" ]; then
        ts_skip_subtest "running under qemu-user emulation"
+       ts_finalize_subtest
        return
     fi
     {