test_stress_02.sh 777 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. # SPDX-License-Identifier: GPL-2.0
  3. . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
  4. ERR_CODE=0
  5. if ! _have_program fio; then
  6. exit "$UBLK_SKIP_CODE"
  7. fi
  8. ublk_io_and_kill_daemon()
  9. {
  10. run_io_and_kill_daemon "$@"
  11. ERR_CODE=$?
  12. if [ ${ERR_CODE} -ne 0 ]; then
  13. echo "$TID failure: $*"
  14. _show_result $TID $ERR_CODE
  15. fi
  16. }
  17. _prep_test "stress" "run IO and kill ublk server"
  18. _create_backfile 0 256M
  19. _create_backfile 1 128M
  20. _create_backfile 2 128M
  21. for nr_queue in 1 4; do
  22. ublk_io_and_kill_daemon 8G -t null -q "$nr_queue" &
  23. ublk_io_and_kill_daemon 256M -t loop -q "$nr_queue" "${UBLK_BACKFILES[0]}" &
  24. ublk_io_and_kill_daemon 256M -t stripe -q "$nr_queue" "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
  25. wait
  26. done
  27. _cleanup_test "stress"
  28. _show_result $TID $ERR_CODE