]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (lsfd/option-inet{,-udp}) make UDPLite related test case skippable
authorMasatake YAMATO <yamato@redhat.com>
Wed, 6 May 2026 09:39:13 +0000 (18:39 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Thu, 7 May 2026 22:10:58 +0000 (07:10 +0900)
Fixes #4311

Linux 7.1-rc1 has removed UDP Lite.
In the test case lsfd/option-inet, UDP Lite was must.

This change moves UDPLite related test parts to a new test
case lsfd/option-inet-udp and makes lsfd/option-inet-udp
skippable on the platform where UDPLite is not implemented.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/expected/lsfd/option-inet
tests/expected/lsfd/option-inet-udplite [new file with mode: 0644]
tests/ts/lsfd/option-inet
tests/ts/lsfd/option-inet-udplite [new file with mode: 0755]

index 66edac9c557ab7c7e09e6335e9a2e04ef27a8b47..2fbfc29206a69c28f10112a9eaeec7639d41b4e8 100644 (file)
@@ -1,14 +1,12 @@
 # --inet
-3       TCP state=listen laddr=127.0.0.1:34567
-4       TCP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
-5       TCP state=established laddr=127.0.0.1:34567 raddr=127.0.0.1:23456
-3     TCPv6 state=listen laddr=[::1]:34567
-4     TCPv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
-5     TCPv6 state=established laddr=[::1]:34567 raddr=[::1]:23456
-3       UDP state=close laddr=127.0.0.1:34567
-4       UDP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
-3 UDPLITEv6 state=close laddr=[::1]:34567
-4 UDPLITEv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
+3   TCP state=listen laddr=127.0.0.1:34567
+4   TCP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
+5   TCP state=established laddr=127.0.0.1:34567 raddr=127.0.0.1:23456
+3 TCPv6 state=listen laddr=[::1]:34567
+4 TCPv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
+5 TCPv6 state=established laddr=[::1]:34567 raddr=[::1]:23456
+3   UDP state=close laddr=127.0.0.1:34567
+4   UDP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
 # --inet=4
 3 TCP state=listen laddr=127.0.0.1:34567
 4 TCP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
 3 UDP state=close laddr=127.0.0.1:34567
 4 UDP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
 # --inet=6
-3     TCPv6 state=listen laddr=[::1]:34567
-4     TCPv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
-5     TCPv6 state=established laddr=[::1]:34567 raddr=[::1]:23456
-3 UDPLITEv6 state=close laddr=[::1]:34567
-4 UDPLITEv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
+3 TCPv6 state=listen laddr=[::1]:34567
+4 TCPv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
+5 TCPv6 state=established laddr=[::1]:34567 raddr=[::1]:23456
 # -i
-3       TCP state=listen laddr=127.0.0.1:34567
-4       TCP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
-5       TCP state=established laddr=127.0.0.1:34567 raddr=127.0.0.1:23456
-3     TCPv6 state=listen laddr=[::1]:34567
-4     TCPv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
-5     TCPv6 state=established laddr=[::1]:34567 raddr=[::1]:23456
-3       UDP state=close laddr=127.0.0.1:34567
-4       UDP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
-3 UDPLITEv6 state=close laddr=[::1]:34567
-4 UDPLITEv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
+3   TCP state=listen laddr=127.0.0.1:34567
+4   TCP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
+5   TCP state=established laddr=127.0.0.1:34567 raddr=127.0.0.1:23456
+3 TCPv6 state=listen laddr=[::1]:34567
+4 TCPv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
+5 TCPv6 state=established laddr=[::1]:34567 raddr=[::1]:23456
+3   UDP state=close laddr=127.0.0.1:34567
+4   UDP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
 # -i4
 3 TCP state=listen laddr=127.0.0.1:34567
 4 TCP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
@@ -39,8 +33,6 @@
 3 UDP state=close laddr=127.0.0.1:34567
 4 UDP state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
 # -i6
-3     TCPv6 state=listen laddr=[::1]:34567
-4     TCPv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
-5     TCPv6 state=established laddr=[::1]:34567 raddr=[::1]:23456
-3 UDPLITEv6 state=close laddr=[::1]:34567
-4 UDPLITEv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
+3 TCPv6 state=listen laddr=[::1]:34567
+4 TCPv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
+5 TCPv6 state=established laddr=[::1]:34567 raddr=[::1]:23456
diff --git a/tests/expected/lsfd/option-inet-udplite b/tests/expected/lsfd/option-inet-udplite
new file mode 100644 (file)
index 0000000..111d3f6
--- /dev/null
@@ -0,0 +1,11 @@
+# --inet
+3  UDP-Lite state=close laddr=127.0.0.1:34567
+4  UDP-Lite state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
+3 UDPLITEv6 state=close laddr=[::1]:34567
+4 UDPLITEv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
+# --inet=4
+3 UDP-Lite state=close laddr=127.0.0.1:34567
+4 UDP-Lite state=established laddr=127.0.0.1:23456 raddr=127.0.0.1:34567
+# --inet=6
+3 UDPLITEv6 state=close laddr=[::1]:34567
+4 UDPLITEv6 state=established laddr=[::1]:23456 raddr=[::1]:34567
index 54982ffe9a00d06b3e2bf8703cabe2876d42e2c0..2cca75bd332f516e0357f0a0c3793c4ebd28ce3e 100755 (executable)
@@ -67,58 +67,50 @@ FIFO=./test_mkfds-option-inet.fifo
        ts_finalize  "$TS_HELPER_MKFDS udp...doesn't report its pid"
     fi
 
-    "$TS_HELPER_MKFDS" -X udp6 3 4 lite=1 server-port=34567 client-port=23456 server-do-bind=1 client-do-bind=1 client-do-connect=1 > "${FIFO}" &
-    if ! read PID4  < "${FIFO}"; then
-       kill -CONT "${PID0}" "${PID1}" "${PID2}" "${PID3}"
-       wait       "${PID0}" "${PID1}" "${PID2}" "${PID3}"
-       rm "${FIFO}"
-       ts_finalize  "$TS_HELPER_MKFDS udp6 lite=1...doesn't report its pid"
-    fi
-
     OPT='--inet'
     echo "# $OPT"
     ${TS_CMD_LSFD} -n \
                   $OPT \
                   -o ASSOC,TYPE,NAME \
-                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3) or (PID == $PID4)"
+                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3)"
 
     OPT='--inet=4'
     echo "# $OPT"
     ${TS_CMD_LSFD} -n \
                   $OPT \
                   -o ASSOC,TYPE,NAME \
-                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3) or (PID == $PID4)"
+                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3)"
 
     OPT='--inet=6'
     echo "# $OPT"
     ${TS_CMD_LSFD} -n \
                   $OPT \
                   -o ASSOC,TYPE,NAME \
-                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3) or (PID == $PID4)"
+                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3)"
 
     OPT='-i'
     echo "# $OPT"
     ${TS_CMD_LSFD} -n \
                   $OPT \
                   -o ASSOC,TYPE,NAME \
-                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3) or (PID == $PID4)"
+                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3)"
 
     OPT='-i4'
     echo "# $OPT"
     ${TS_CMD_LSFD} -n \
                   $OPT \
                   -o ASSOC,TYPE,NAME \
-                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3) or (PID == $PID4)"
+                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3)"
 
     OPT='-i6'
     echo "# $OPT"
     ${TS_CMD_LSFD} -n \
                   $OPT \
                   -o ASSOC,TYPE,NAME \
-                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3) or (PID == $PID4)"
+                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2) or (PID == $PID3)"
 
-    kill -CONT "${PID0}" "${PID1}" "${PID2}" "${PID3}" "${PID4}"
-    wait       "${PID0}" "${PID1}" "${PID2}" "${PID3}" "${PID4}"
+    kill -CONT "${PID0}" "${PID1}" "${PID2}" "${PID3}"
+    wait       "${PID0}" "${PID1}" "${PID2}" "${PID3}"
     rm "${FIFO}"
 } > "$TS_OUTPUT" 2>&1
 
diff --git a/tests/ts/lsfd/option-inet-udplite b/tests/ts/lsfd/option-inet-udplite
new file mode 100755 (executable)
index 0000000..60d3e3e
--- /dev/null
@@ -0,0 +1,113 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2026 Masatake YAMATO <yamato@redhat.com>
+#
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+TS_TOPDIR="${0%/*}/../.."
+
+# UDPLITE was retired in Linux 7.1-rc1.
+# We move UDP-Lite related test parts here from the
+# option-inet test case. So we can make UDP-Lite related
+# test parts optional where UDPLITE is not available.
+TS_DESC="--inet option for UDPLITE"
+
+
+. "$TS_TOPDIR"/functions.sh
+
+ts_init "$*"
+ts_skip_qemu_user
+ts_skip_docker
+
+ts_check_test_command "$TS_CMD_LSFD"
+ts_check_test_command "$TS_HELPER_MKFDS"
+ts_check_ipv6
+
+ts_check_prog "mkfifo"
+
+ts_cd "$TS_OUTDIR"
+
+. "$TS_SELF/lsfd-functions.bash"
+
+readonly -a UDP_ARGS=(3 4
+                     lite=1
+                     server-port=34567
+                     client-port=23456
+                     server-do-bind=1
+                     client-do-bind=1
+                     client-do-connect=1)
+
+lsfd_check_udp_lite 4
+lsfd_check_udp_lite 6
+
+FIFO=./test_mkfds-option-inet-udplite.fifo
+{
+    rm -f "${FIFO}"
+    if ! mkfifo "${FIFO}"; then
+       ts_finalize  "failed in creating a fifo"
+    fi
+
+    "$TS_HELPER_MKFDS" -X ro-regular-file 3 file=/etc/passwd > "${FIFO}" &
+    if ! read PID0  < "${FIFO}"; then
+       rm "${FIFO}"
+       ts_finalize  "$TS_HELPER_MKFDS ro-regular-file...doesn't report its pid"
+    fi
+
+    "$TS_HELPER_MKFDS" -X udp "${UDP_ARGS[@]}" > "${FIFO}" &
+    if ! read PID1  < "${FIFO}"; then
+       kill -CONT "${PID0}"
+       wait       "${PID0}"
+       rm "${FIFO}"
+       ts_finalize  "$TS_HELPER_MKFDS udp lite=1...doesn't report its pid"
+    fi
+
+    "$TS_HELPER_MKFDS" -X udp6 "${UDP_ARGS[@]}" > "${FIFO}" &
+    if ! read PID2  < "${FIFO}"; then
+       kill -CONT "${PID0}" "${PID1}"
+       wait       "${PID0}" "${PID1}"
+       rm "${FIFO}"
+       ts_finalize  "$TS_HELPER_MKFDS udp6 lite=1...doesn't report its pid"
+    fi
+
+    OPT='--inet'
+    echo "# $OPT"
+    ${TS_CMD_LSFD} -n \
+                  $OPT \
+                  -o ASSOC,TYPE,NAME \
+                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2)"
+
+    OPT='--inet=4'
+    echo "# $OPT"
+    ${TS_CMD_LSFD} -n \
+                  $OPT \
+                  -o ASSOC,TYPE,NAME \
+                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2)"
+
+    OPT='--inet=6'
+    echo "# $OPT"
+    ${TS_CMD_LSFD} -n \
+                  $OPT \
+                  -o ASSOC,TYPE,NAME \
+                  -Q "(PID == $PID0) or (PID == $PID1) or (PID == $PID2)"
+
+    kill -CONT "${PID0}" "${PID1}" "${PID2}"
+    if ! wait  "${PID0}" "${PID1}" "${PID2}"; then
+       echo PID0: ${PID0}
+       echo PID1: ${PID1}
+       echo PID2: ${PID2}
+    fi
+
+    rm "${FIFO}"
+} > "$TS_OUTPUT" 2>&1
+
+ts_finalize