Skip to content

Commit

Permalink
tests/qcow2: add two tests for covering big image test
Browse files Browse the repository at this point in the history
Big qcow2 image shouldn't be done automatically since the environment may
not hold such big file, so just run manually.

Signed-off-by: Ming Lei <[email protected]>
  • Loading branch information
ming1 committed Dec 13, 2022
1 parent 5a9f67a commit 061a794
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tests/qcow2/64G_fs_io
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

. common/fio_common
. common/qcow2_common

echo "run fs randwrite with verify over ublk-qcow2"

IMG_SIZE=64G
file=`_create_qcow2_image "null" $IMG_SIZE`

QUEUES=1
URING_COMP=0
NEED_GET_DATA=0

export T_TYPE_PARAMS="-t qcow2 -q $QUEUES -u $URING_COMP -g $NEED_GET_DATA -f $file"
echo -e "\trun fio(fs randwrite with verify) over ublk($T_TYPE_PARAMS)"

DEV=`__create_ublk_dev`

MNT=`mktemp -d`

mkfs.xfs -f $DEV > /dev/null 2>&1
mount $DEV $MNT > /dev/null 2>&1

fio --size=32G --bsrange=4k-128k --runtime=20 --numjobs=12 --ioengine=libaio \
--iodepth=64 --iodepth_batch_submit=16 --iodepth_batch_complete_min=16 \
--directory=$MNT --group_reporting=1 --unlink=0 \
--direct=1 --fsync=0 --name=f1 --stonewall \
--overwrite=1 --rw=randwrite --verify=md5 > /dev/null 2>&1
umount $MNT > /dev/null 2>&1

RES=`__remove_ublk_dev_return $DEV`
if [ $RES -ne 0 ]; then
echo -e "\tdelete ublk0 failed"
exit -1
fi

_remove_qcow2_image $file

rm -fr $MNT
14 changes: 14 additions & 0 deletions tests/qcow2/64G_io
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

. common/fio_common
. common/qcow2_common

echo "run perf test on empty qcow2 image via ublk"

file=`_create_qcow2_image "null" 64G`
export T_TYPE_PARAMS="-t qcow2 -q 1 -f $file"

__run_dev_perf 1

_remove_qcow2_image $file

0 comments on commit 061a794

Please sign in to comment.