From: Sam Li <faithilikerun@gmail.com>
To: qemu-devel@nongnu.org
Cc: hare@suse.de, Hanna Reitz <hreitz@redhat.com>,
dmitry.fomichev@wdc.com, Kevin Wolf <kwolf@redhat.com>,
Fam Zheng <fam@euphon.net>, Stefan Hajnoczi <stefanha@redhat.com>,
damien.lemoal@opensource.wdc.com, qemu-block@nongnu.org,
Sam Li <faithilikerun@gmail.com>
Subject: [RFC v3 5/5] qemu-iotests: add zone operation tests.
Date: Mon, 27 Jun 2022 08:19:17 +0800 [thread overview]
Message-ID: <20220627001917.9417-6-faithilikerun@gmail.com> (raw)
In-Reply-To: <20220627001917.9417-1-faithilikerun@gmail.com>
---
tests/qemu-iotests/tests/zoned.sh | 49 +++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100755 tests/qemu-iotests/tests/zoned.sh
diff --git a/tests/qemu-iotests/tests/zoned.sh b/tests/qemu-iotests/tests/zoned.sh
new file mode 100755
index 0000000000..262c0b5427
--- /dev/null
+++ b/tests/qemu-iotests/tests/zoned.sh
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+#
+# Test zone management operations.
+#
+
+QEMU_IO="build/qemu-io"
+IMG="--image-opts driver=zoned_host_device,filename=/dev/nullb0"
+QEMU_IO_OPTIONS=$QEMU_IO_OPTIONS_NO_FMT
+
+echo "Testing a null_blk device"
+echo "Simple cases: if the operations work"
+sudo modprobe null_blk nr_devices=1 zoned=1
+# hidden issues:
+# 1. memory allocation error of "unaligned tcache chunk detected" when the nr_zone=1 in zone report
+# 2. qemu-io: after report 10 zones, the program failed at double free error and exited.
+echo "report the first zone"
+sudo $QEMU_IO $IMG -c "zone_report 0 0 1"
+echo "report: the first 10 zones"
+sudo $QEMU_IO $IMG -c "zone_report 0 0 10"
+
+echo "open the first zone"
+sudo $QEMU_IO $IMG -c "zone_open 0 0x80000"
+echo "report after:"
+sudo $QEMU_IO $IMG -c "zone_report 0 0 1"
+echo "open the last zone"
+sudo $QEMU_IO $IMG -c "zone_open 0x3e70000000 0x80000"
+echo "report after:"
+sudo $QEMU_IO $IMG -c "zone_report 0x3e70000000 0 2"
+
+echo "close the first zone"
+sudo $QEMU_IO $IMG -c "zone_close 0 0x80000"
+echo "report after:"
+sudo $QEMU_IO $IMG -c "zone_report 0 0 1"
+echo "close the last zone"
+sudo $QEMU_IO $IMG -c "zone_close 0x3e70000000 0x80000"
+echo "report after:"
+sudo $QEMU_IO $IMG -c "zone_report 0x3e70000000 0 2"
+
+
+echo "reset the second zone"
+sudo $QEMU_IO $IMG -c "zone_reset 0x80000 0x80000"
+echo "After resetting a zone:"
+sudo $QEMU_IO $IMG -c "zone_report 0x80000 0 5"
+
+# success, all done
+sudo rmmod null_blk
+echo "*** done"
+#rm -f $seq.full
+status=0
--
2.35.3
next prev parent reply other threads:[~2022-06-27 0:24 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 0:19 [RFC v3 0/5] *** Add support for zoned device *** Sam Li
2022-06-27 0:19 ` [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls Sam Li
2022-06-27 7:21 ` Hannes Reinecke
2022-06-27 7:45 ` Sam Li
2022-06-27 14:15 ` Stefan Hajnoczi
2022-06-28 8:05 ` Sam Li
2022-06-28 9:05 ` Damien Le Moal
2022-06-28 10:23 ` Sam Li
2022-06-29 1:43 ` Damien Le Moal
2022-06-29 1:50 ` Sam Li
2022-06-29 2:32 ` Damien Le Moal
2022-06-29 2:35 ` Sam Li
2022-06-27 0:19 ` [RFC v3 2/5] qemu-io: add zoned block device operations Sam Li
2022-06-27 7:30 ` Hannes Reinecke
2022-06-27 8:31 ` Sam Li
2022-06-28 7:56 ` Stefan Hajnoczi
2022-06-28 9:02 ` Sam Li
2022-06-28 9:11 ` Damien Le Moal
2022-06-28 10:27 ` Sam Li
2022-06-27 0:19 ` [RFC v3 3/5] file-posix: introduce get_sysfs_long_val for zoned device information Sam Li
2022-06-27 7:31 ` Hannes Reinecke
2022-06-27 8:32 ` Sam Li
2022-06-28 8:09 ` Stefan Hajnoczi
2022-06-28 9:18 ` Sam Li
2022-06-27 0:19 ` [RFC v3 4/5] file-posix: introduce get_sysfs_str_val for device zoned model Sam Li
2022-06-27 7:41 ` Hannes Reinecke
2022-06-27 8:44 ` Sam Li
2022-06-27 0:19 ` Sam Li [this message]
2022-06-27 7:42 ` [RFC v3 5/5] qemu-iotests: add zone operation tests Hannes Reinecke
2022-06-28 8:19 ` Stefan Hajnoczi
2022-06-28 9:34 ` Sam Li
2022-06-30 10:11 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220627001917.9417-6-faithilikerun@gmail.com \
--to=faithilikerun@gmail.com \
--cc=damien.lemoal@opensource.wdc.com \
--cc=dmitry.fomichev@wdc.com \
--cc=fam@euphon.net \
--cc=hare@suse.de \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).