fstests: skip AIO-related tests when CONFIG_AIO=n

When running xfstests on a kernel configured with CONFIG_AIO=n, all
AIO-related tests fail, often due to an error similar to the
following:

    error Function not implemented during io_setup

This affected at least the following tests: generic/036,
generic/112, generic/113, generic/198, generic/207, generic/208,
generic/210, generic/211, generic/239, generic/323, generic/427,
xfs/240, xfs/241.

Fix this by enhancing the 'feature' program to allow testing for
asynchronous I/O support, then skipping all AIO-related tests when
AIO is unsupported.

This change is useful because CONFIG_AIO is sometimes disabled to
reduce the kernel's attack surface (e.g. see
https://android-review.googlesource.com/#/c/292158/).

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Eric Biggers
2017-05-18 15:49:10 -07:00
committed by Eryu Guan
parent aaf96798d8
commit 9000551d9b
7 changed files with 62 additions and 7 deletions
+1
View File
@@ -122,6 +122,7 @@ _process_args()
_supported_fs generic
_supported_os Linux
_require_test
_require_aio
[ -x $here/ltp/aio-stress ] || \
_notrun "fsx not built with AIO for this platform"
+1
View File
@@ -77,6 +77,7 @@ _do_test()
_supported_fs generic
_supported_os Linux
_require_test
_require_aio
_require_odirect
[ -x $here/ltp/aio-stress ] || _notrun "aio-stress not built for this platform"
+1 -2
View File
@@ -49,9 +49,8 @@ _require_scratch_reflink
_require_cp_reflink
_require_dm_target error
_require_xfs_io_command "cowextsize"
_require_test_program "aio-dio-regress/aiocp"
_require_aiodio "aiocp"
AIO_TEST="src/aio-dio-regress/aiocp"
_require_odirect
rm -f $seqres.full
+1 -2
View File
@@ -46,9 +46,8 @@ _supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_xfs_io_command "cowextsize"
_require_test_program "aio-dio-regress/aiocp"
_require_aiodio "aiocp"
AIO_TEST="src/aio-dio-regress/aiocp"
_require_odirect
rm -f $seqres.full