]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add skips when IPv6 is not supported
authorLiviaMedeiros <livia@cirno.name>
Mon, 16 Dec 2024 10:40:37 +0000 (11:40 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Dec 2024 10:40:37 +0000 (11:40 +0100)
Before this change on systems with disabled IPv6 (e.g. `CONFIG_IPV6 is
not set` in kernel config), `lsfd/mkfds-tcp6` and `lsfd/mkfds-udp6` were
failing, and `lsfd/option-inet` was hanging forever, making it
impossible to complete the tests.

Signed-off-by: LiviaMedeiros <livia@cirno.name>
Reviewed-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/functions.sh
tests/ts/lsfd/mkfds-tcp6
tests/ts/lsfd/mkfds-udp6
tests/ts/lsfd/option-inet

index 6301668715dc0ac06a61817d56a864e26e43c5cf..d5a92c91c80e7804101cfcd66dac9c2b52b83cff 100644 (file)
@@ -1195,3 +1195,9 @@ function ts_check_enosys_syscalls {
 function ts_skip_docker {
        test -e /.dockerenv && ts_skip "unsupported in docker environment"
 }
+
+function ts_check_ipv6 {
+       if [ ! -e /proc/net/if_inet6 ]; then
+               ts_skip "IPv6 is not supported"
+       fi
+}
index bffa630c46e555a85c0f07280debb95ba5dc666c..414777f4a074b129cad4b13085c730f218411ce6 100755 (executable)
@@ -23,6 +23,7 @@ ts_init "$*"
 ts_check_test_command "$TS_CMD_LSFD"
 ts_check_test_command "$TS_HELPER_MKFDS"
 ts_check_native_byteorder
+ts_check_ipv6
 ts_skip_docker
 
 ts_cd "$TS_OUTDIR"
index 26bdacd7c8b8de73ce476ce32f74190ed2b4c010..59b1c06a20c7772c0406f14a52b0f30959782cc2 100755 (executable)
@@ -23,6 +23,7 @@ ts_init "$*"
 ts_check_test_command "$TS_CMD_LSFD"
 ts_check_test_command "$TS_HELPER_MKFDS"
 ts_check_native_byteorder
+ts_check_ipv6
 ts_skip_docker
 
 ts_cd "$TS_OUTDIR"
index 7ca88375165cc4ecfd44581fafabf307c286fe84..f679f121decd558b56776b755205f874f9b3bcbe 100755 (executable)
@@ -24,6 +24,7 @@ ts_skip_docker
 
 ts_check_test_command "$TS_CMD_LSFD"
 ts_check_test_command "$TS_HELPER_MKFDS"
+ts_check_ipv6
 
 ts_check_prog "mkfifo"