Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GIT PULL] Test fixes and compatibility with older kernels #1354

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

calebsander
Copy link
Contributor

Fix some testing gaps where errors would not cause the tests to fail.

Also add some -EINVAL result checks to allow tests to skip rather than fail on older kernels (tested on 5.15).


git request-pull output:

The following changes since commit 5c788d514b9ed6d1a3624150de8aa6db403c1c65:

  Fix missing `aligned_alloc()` on some Android devices (2025-02-20 07:51:15 -0700)

are available in the Git repository at:

  [email protected]:calebsander/liburing.git fix/test-einval

for you to fetch changes up to c7fd16a7d7af305384c44baa74b4bd07bb378295:

  test/wq-aff: check io_uring_queue_init_params() success (2025-02-23 11:22:53 -0700)

----------------------------------------------------------------
Caleb Sander Mateos (6):
      test/connect: propagate return value from test()
      test/connect: skip on -EINVAL in io_uring_setup
      test/iopoll-overflow: skip on -EINVAL in io_uring_setup
      test/resize-rings: skip on -EINVAL in io_uring_setup
      test/timeout: skip test_update_multishot_timeouts if not supported
      test/wq-aff: check io_uring_queue_init_params() success

 test/connect.c         | 18 +++++++++++-------
 test/iopoll-overflow.c |  6 +++---
 test/resize-rings.c    |  2 ++
 test/timeout.c         |  5 ++++-
 test/wq-aff.c          |  6 +++++-
 5 files changed, 25 insertions(+), 12 deletions(-)

By submitting this pull request, I acknowledge that:

  1. I have followed the above pull request guidelines.
  2. I have the rights to submit this work under the same license.
  3. I agree to a Developer Certificate of Origin (see https://developercertificate.org for more information).

test() returns T_EXIT_{FAIL,PASS,SKIP}, but main() checks for a return
value of -1 to indicate failure. Ensure failures are reported by
checking the return value against T_EXIT_FAIL instead. Return
T_EXIT_FAIL from main() if any test failed, T_EXIT_SKIP if all were
skipped, and T_EXIT_PASS if any passed and none failed.

Remove the redundant if (no_connect) check in main(); test() already
returns T_EXIT_SKIP in that case.

Signed-off-by: Caleb Sander Mateos <[email protected]>
Older kernels don't support IORING_SETUP_SINGLE_ISSUER and
IORING_SETUP_DEFER_TASKRUN, causing io_uring_setup() to return -EINVAL.
Return T_EXIT_SKIP in this case like other tests do to avoid reporting
failure.

Also correct the name of the function in the failure line;
"io_uring_queue_setup" is not a thing.

Signed-off-by: Caleb Sander Mateos <[email protected]>
Older kernels don't support IORING_SETUP_SUBMIT_ALL, causing
io_uring_setup() to return -EINVAL. Return T_EXIT_SKIP in this case like
other tests do to avoid reporting failure.

Signed-off-by: Caleb Sander Mateos <[email protected]>
Older kernels don't support IORING_SETUP_SINGLE_ISSUER or
IORING_SETUP_DEFER_TASKRUN, causing io_uring_setup() to return -EINVAL.
Return T_EXIT_SKIP in this case like other tests do to avoid reporting
failure.

Signed-off-by: Caleb Sander Mateos <[email protected]>
Older kernels don't support IORING_TIMEOUT_MULTISHOT, causing SQEs that
set the flag to immediately post a CQE with res = -EINVAL.
test_timeout_multishot() already checks for this and sets no_multishot,
which causes most other IORING_TIMEOUT_MULTISHOT test cases to skip.
However, test_update_multishot_timeouts() doesn't check no_multishot and
fails on kernels without support. So add the check and skip that test
case too if no_multishot is set. Catch the T_EXIT_SKIP return value in
main() and continue running the other test cases.

Signed-off-by: Caleb Sander Mateos <[email protected]>
Check that io_uring_queue_init_params() returns 0. Fail the test if not.

Signed-off-by: Caleb Sander Mateos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant