xref: /linux/tools/testing/selftests/ublk/test_batch_03.sh (revision 3a4d8bed0b47543b2dfce0b1d714b40d68ff2f7e)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4. "$(cd "$(dirname "$0")" && pwd)"/test_common.sh
5
6ERR_CODE=0
7
8if ! _have_feature "BATCH_IO"; then
9	exit "$UBLK_SKIP_CODE"
10fi
11
12if ! _have_program fio; then
13	exit "$UBLK_SKIP_CODE"
14fi
15
16_prep_test "generic" "test UBLK_F_BATCH_IO with 1_threads vs. 4_queues"
17
18_create_backfile 0 512M
19
20dev_id=$(_add_ublk_dev -t loop -q 4 --nthreads 1 -b "${UBLK_BACKFILES[0]}")
21_check_add_dev $TID $?
22
23# run fio over the ublk disk
24fio --name=job1 --filename=/dev/ublkb"${dev_id}" --ioengine=libaio --rw=readwrite \
25	--iodepth=32 --size=100M --numjobs=4 > /dev/null 2>&1
26ERR_CODE=$?
27
28_cleanup_test "generic"
29_show_result $TID $ERR_CODE
30