From: LiviaMedeiros Date: Mon, 16 Dec 2024 10:40:37 +0000 (+0100) Subject: tests: add skips when IPv6 is not supported X-Git-Tag: v2.42-start~117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8497235c9be909857be38995ac0061d7a25b4357;p=thirdparty%2Futil-linux.git tests: add skips when IPv6 is not supported 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 Reviewed-by: Masatake YAMATO Signed-off-by: Karel Zak --- diff --git a/tests/functions.sh b/tests/functions.sh index 630166871..d5a92c91c 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -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 +} diff --git a/tests/ts/lsfd/mkfds-tcp6 b/tests/ts/lsfd/mkfds-tcp6 index bffa630c4..414777f4a 100755 --- a/tests/ts/lsfd/mkfds-tcp6 +++ b/tests/ts/lsfd/mkfds-tcp6 @@ -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" diff --git a/tests/ts/lsfd/mkfds-udp6 b/tests/ts/lsfd/mkfds-udp6 index 26bdacd7c..59b1c06a2 100755 --- a/tests/ts/lsfd/mkfds-udp6 +++ b/tests/ts/lsfd/mkfds-udp6 @@ -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" diff --git a/tests/ts/lsfd/option-inet b/tests/ts/lsfd/option-inet index 7ca883751..f679f121d 100755 --- a/tests/ts/lsfd/option-inet +++ b/tests/ts/lsfd/option-inet @@ -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"