From 8e94f3a3cf8e3528597fddd60d69a4931d392ad3 Mon Sep 17 00:00:00 2001 From: Anna Wilcox Date: Sun, 22 Mar 2026 21:58:39 -0500 Subject: [PATCH] test_enosys: Handle musl libc error strings strerror(3) on musl gives different strings for some of the errnos we test for, so the tests incorrectly fail on musl. Change the strings back into the glibc ones so they match the expected values properly. Signed-off-by: Anna Wilcox Suggested-by: Sam James --- tests/ts/enosys/enosys | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/ts/enosys/enosys b/tests/ts/enosys/enosys index 591b292a8..698283056 100755 --- a/tests/ts/enosys/enosys +++ b/tests/ts/enosys/enosys @@ -20,6 +20,12 @@ TS_DESC="enosys" . "$TS_TOPDIR"/functions.sh ts_init "$*" +function ts_canonicalise_strerror { + sed -Ei -e 's/Out of memory/Cannot allocate memory/g' \ + -e 's/Not a tty/Inappropriate ioctl for device/g' \ + -e 's/No error information/Success/g' $1 +} + ts_check_test_command "$TS_HELPER_ENOSYS" ts_check_enosys_syscalls fallocate fsopen execve @@ -34,6 +40,8 @@ $FALLOCATE_TEST > /dev/null 2>> "$TS_OUTPUT" "$TS_CMD_ENOSYS" --syscall fallocate:12 $FALLOCATE_TEST > /dev/null 2>> "$TS_OUTPUT" "$TS_CMD_ENOSYS" --syscall fallocate:ENOMEM $FALLOCATE_TEST > /dev/null 2>> "$TS_OUTPUT" +ts_canonicalise_strerror "$TS_OUTPUT" + ts_finalize_subtest ts_init_subtest exec @@ -43,6 +51,8 @@ FALLOCATE_TEST="$TS_HELPER_ENOSYS exec" $FALLOCATE_TEST > /dev/null 2>> "$TS_OUTPUT" "$TS_CMD_ENOSYS" --syscall execve $FALLOCATE_TEST > /dev/null 2>> "$TS_OUTPUT" +ts_canonicalise_strerror "$TS_OUTPUT" + ts_finalize_subtest ts_init_subtest ioctl @@ -57,6 +67,8 @@ $FALLOCATE_TEST > /dev/null 2>> "$TS_OUTPUT" "$TS_CMD_ENOSYS" --ioctl FIOCLEX:12 $FALLOCATE_TEST > /dev/null 2>> "$TS_OUTPUT" "$TS_CMD_ENOSYS" --ioctl FIOCLEX:ENOMEM $FALLOCATE_TEST > /dev/null 2>> "$TS_OUTPUT" +ts_canonicalise_strerror "$TS_OUTPUT" + ts_finalize_subtest ts_finalize -- 2.52.0