From: Thomas Weißschuh Date: Tue, 30 May 2023 18:01:49 +0000 (+0200) Subject: test_enosys: fix build on old kernels X-Git-Tag: v2.40-rc1~421^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ff6f9d9ab2509f3a6fedb5bd9d575662dd47280;p=thirdparty%2Futil-linux.git test_enosys: fix build on old kernels Fixes #2277 Signed-off-by: Thomas Weißschuh --- diff --git a/tests/functions.sh b/tests/functions.sh index 2223233809..ada94012f6 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -1158,3 +1158,9 @@ function ts_is_virt { done return 1 } + +function ts_check_enosys_syscalls { + ts_check_test_command "$TS_CMD_ENOSYS" + "$TS_CMD_ENOSYS" ${@/#/-s } true 2> /dev/null + [ $? -ne 0 ] && ts_skip "test_enosys does not work: $*" +} diff --git a/tests/ts/misc/enosys b/tests/ts/misc/enosys index 2a8241296f..bf92ae376c 100755 --- a/tests/ts/misc/enosys +++ b/tests/ts/misc/enosys @@ -20,11 +20,8 @@ TS_DESC="enosys" . "$TS_TOPDIR"/functions.sh ts_init "$*" -ts_check_test_command "$TS_CMD_ENOSYS" ts_check_test_command "$TS_HELPER_ENOSYS" - -"$TS_CMD_ENOSYS" true 2> /dev/null -[ "$?" -eq "$TS_EXIT_NOTSUPP" ] && ts_skip "enosys does not work" +ts_check_enosys_syscalls fallocate fsopen execve ts_init_subtest basic diff --git a/tests/ts/mount/fallback b/tests/ts/mount/fallback index b225be189a..cbdf449b25 100755 --- a/tests/ts/mount/fallback +++ b/tests/ts/mount/fallback @@ -6,15 +6,13 @@ TS_DESC="fstab-fallback" . "$TS_TOPDIR"/functions.sh ts_init "$*" -ts_check_test_command "$TS_CMD_ENOSYS" ts_check_test_command "$TS_CMD_MOUNT" ts_check_test_command "$TS_CMD_UMOUNT" ts_check_test_command "$TS_CMD_FINDMNT" ts_check_test_command "$TS_CMD_LOSETUP" +ts_check_enosys_syscalls open_tree fsopen mount_setattr ts_skip_nonroot -"$TS_CMD_ENOSYS" true 2> /dev/null -[ "$?" -eq "$TS_EXIT_NOTSUPP" ] && ts_skip "enosys does not work" test_mount_fallback() { ts_init_subtest "$1"