]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
test_enosys: fix build on old kernels
authorThomas Weißschuh <thomas@t-8ch.de>
Tue, 30 May 2023 18:01:49 +0000 (20:01 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 30 May 2023 18:10:02 +0000 (20:10 +0200)
Fixes #2277

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
tests/functions.sh
tests/ts/misc/enosys
tests/ts/mount/fallback

index 2223233809ed369c416e0d0b3d1a75702234456b..ada94012f67e752ab095952432f445d410dcc5f4 100644 (file)
@@ -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: $*"
+}
index 2a8241296f5c2a7f0d3953aee6af256ec2944520..bf92ae376c20a7ff9a048dd048ab4c6e76aca8c5 100755 (executable)
@@ -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
 
index b225be189a92eb758a1deecae6a7f49924ed5298..cbdf449b25d75fdd018ad9af15e13fcaa314651d 100755 (executable)
@@ -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"