xref: /aosp_15_r20/external/ublksrv/tests/qcow2/041 (revision 94c4a1e103eb1715230460aab379dff275992c20)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4. common/fio_common
5. common/qcow2_common
6
7echo "run fs randwrite with verify over ublk-qcow2"
8
9file=`_create_qcow2_image "null" $QCOW2_IMG_SZ`
10
11QUEUES=1
12URING_COMP=0
13NEED_GET_DATA=0
14
15export T_TYPE_PARAMS="-t qcow2 -q $QUEUES -u $URING_COMP -g $NEED_GET_DATA -f $file"
16echo -e "\trun fio(fs randwrite with verify) over ublk($T_TYPE_PARAMS)"
17
18DEV=`__create_ublk_dev`
19
20MNT=`mktemp -d`
21
22mkfs.xfs -f $DEV > /dev/null 2>&1
23mount $DEV $MNT > /dev/null 2>&1
24
25fio --size=128M --bsrange=4k-128k --runtime=20 --numjobs=12 --ioengine=libaio \
26	--iodepth=64 --iodepth_batch_submit=16 --iodepth_batch_complete_min=16 \
27	--directory=$MNT --group_reporting=1 --unlink=0 \
28	--direct=1 --fsync=0 --name=f1 --stonewall \
29	--overwrite=1 --rw=randwrite --verify=md5 > /dev/null 2>&1
30umount $MNT > /dev/null 2>&1
31
32RES=`__remove_ublk_dev_return $DEV`
33if [ $RES -ne 0 ]; then
34	echo -e "\tdelete ublk0 failed"
35	exit -1
36fi
37
38_remove_qcow2_image $file
39
40rm -fr $MNT
41