test_stress_06.sh 992 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. _prep_test "stress" "run IO and remove device (user copy)"
  18. _create_backfile 0 256M
  19. _create_backfile 1 128M
  20. _create_backfile 2 128M
  21. ublk_io_and_remove 8G -t null -q 4 -u &
  22. ublk_io_and_remove 256M -t loop -q 4 -u "${UBLK_BACKFILES[0]}" &
  23. ublk_io_and_remove 256M -t stripe -q 4 -u "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
  24. wait
  25. ublk_io_and_remove 8G -t null -q 4 -u --nthreads 8 --per_io_tasks &
  26. ublk_io_and_remove 256M -t loop -q 4 -u --nthreads 8 --per_io_tasks "${UBLK_BACKFILES[0]}" &
  27. ublk_io_and_remove 256M -t stripe -q 4 -u --nthreads 8 --per_io_tasks "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
  28. wait
  29. _cleanup_test "stress"
  30. _show_result $TID $ERR_CODE