test_stress_08.sh 993 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # SPDX-License-Identifier: GPL-2.0
  3. . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
  4. ERR_CODE=0
  5. ublk_io_and_remove()
  6. {
  7. run_io_and_remove "$@"
  8. ERR_CODE=$?
  9. if [ ${ERR_CODE} -ne 0 ]; then
  10. echo "$TID failure: $*"
  11. _show_result $TID $ERR_CODE
  12. fi
  13. }
  14. if ! _have_program fio; then
  15. exit "$UBLK_SKIP_CODE"
  16. fi
  17. if ! _have_feature "ZERO_COPY"; then
  18. exit "$UBLK_SKIP_CODE"
  19. fi
  20. if ! _have_feature "AUTO_BUF_REG"; then
  21. exit "$UBLK_SKIP_CODE"
  22. fi
  23. if ! _have_feature "BATCH_IO"; then
  24. exit "$UBLK_SKIP_CODE"
  25. fi
  26. _prep_test "stress" "run IO and remove device(zero copy)"
  27. _create_backfile 0 256M
  28. _create_backfile 1 128M
  29. _create_backfile 2 128M
  30. ublk_io_and_remove 8G -t null -q 4 -b &
  31. ublk_io_and_remove 256M -t loop -q 4 --auto_zc -b "${UBLK_BACKFILES[0]}" &
  32. ublk_io_and_remove 256M -t stripe -q 4 --auto_zc -b "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
  33. ublk_io_and_remove 8G -t null -q 4 -z --auto_zc --auto_zc_fallback -b &
  34. wait
  35. _cleanup_test "stress"
  36. _show_result $TID $ERR_CODE