All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Li <faithilikerun@gmail.com>
To: qemu-devel@nongnu.org
Cc: damien.lemoal@opensource.wdc.com,
	Markus Armbruster <armbru@redhat.com>,
	dmitry.fomichev@wdc.com, Stefan Hajnoczi <stefanha@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>,
	qemu-block@nongnu.org, Eric Blake <eblake@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>, Fam Zheng <fam@euphon.net>,
	hare@suse.de, Sam Li <faithilikerun@gmail.com>
Subject: [RFC v4 5/9] qemu-iotests: test new zone operations.
Date: Tue, 12 Jul 2022 10:13:41 +0800	[thread overview]
Message-ID: <20220712021345.8530-6-faithilikerun@gmail.com> (raw)
In-Reply-To: <20220712021345.8530-1-faithilikerun@gmail.com>

We have added new block layer APIs of zoned block devices. Test it with:
(1) Create a null_blk device, run each zone operation on it and see
whether reporting right zone information.

Signed-off-by: Sam Li <faithilikerun@gmail.com>
---
 tests/qemu-iotests/tests/zoned.sh | 69 +++++++++++++++++++++++++++++++
 1 file changed, 69 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..e14a3a420e
--- /dev/null
+++ b/tests/qemu-iotests/tests/zoned.sh
@@ -0,0 +1,69 @@
+#!/usr/bin/env bash
+#
+# Test zone management operations.
+#
+
+seq="$(basename $0)"
+echo "QA output created by $seq"
+status=1 # failure is the default!
+
+_cleanup()
+{
+  _cleanup_test_img
+  sudo rmmod null_blk
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.qemu
+
+# This test only runs on Linux hosts with raw image files.
+_supported_fmt raw
+_supported_proto file
+_supported_os Linux
+
+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 "zr 0 0 1"
+echo "report: the first 10 zones"
+sudo $QEMU_IO $IMG -c "zr 0 0 10"
+
+echo "open the first zone"
+sudo $QEMU_IO $IMG -c "zo 0 0x80000"
+echo "report after:"
+sudo $QEMU_IO $IMG -c "zr 0 0 1"
+echo "open the last zone"
+sudo $QEMU_IO $IMG -c "zo 0x3e70000000 0x80000"
+echo "report after:"
+sudo $QEMU_IO $IMG -c "zr 0x3e70000000 0 2"
+
+echo "close the first zone"
+sudo $QEMU_IO $IMG -c "zc 0 0x80000"
+echo "report after:"
+sudo $QEMU_IO $IMG -c "zr 0 0 1"
+echo "close the last zone"
+sudo $QEMU_IO $IMG -c "zc 0x3e70000000 0x80000"
+echo "report after:"
+sudo $QEMU_IO $IMG -c "zr 0x3e70000000 0 2"
+
+
+echo "reset the second zone"
+sudo $QEMU_IO $IMG -c "zrs 0x80000 0x80000"
+echo "After resetting a zone:"
+sudo $QEMU_IO $IMG -c "zr 0x80000 0 5"
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
-- 
2.36.1



  parent reply	other threads:[~2022-07-12  2:23 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12  2:13 [RFC v4 0/9] Add support for zoned device Sam Li
2022-07-12  2:13 ` [RFC v4 1/9] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls Sam Li
2022-07-12  6:10   ` Hannes Reinecke
2022-07-12  6:17     ` Sam Li
2022-07-12  7:35   ` Damien Le Moal
2022-07-13  0:54     ` Sam Li
2022-07-12 15:49   ` Stefan Hajnoczi
2022-07-12 22:12     ` Damien Le Moal
2022-07-13  6:22       ` Stefan Hajnoczi
2022-07-13  0:51     ` Sam Li
2022-07-13  6:19       ` Stefan Hajnoczi
2022-07-12  2:13 ` [RFC v4 2/9] qemu-io: add zoned block device operations Sam Li
2022-07-12  6:14   ` Hannes Reinecke
2022-07-12  7:44   ` Damien Le Moal
2022-07-27 14:13   ` Stefan Hajnoczi
2022-07-28  1:57     ` Damien Le Moal
2022-07-12  2:13 ` [RFC v4 3/9] file-posix: introduce get_sysfs_long_val for a block queue of sysfs attribute Sam Li
2022-07-12  6:16   ` Hannes Reinecke
2022-07-12  7:37   ` Damien Le Moal
2022-07-12  2:13 ` [RFC v4 4/9] file-posix: introduce get_sysfs_str_val for device zoned model Sam Li
2022-07-12  6:17   ` Hannes Reinecke
2022-07-12  6:35     ` Damien Le Moal
2022-07-12  7:42   ` Damien Le Moal
2022-07-12  2:13 ` Sam Li [this message]
2022-07-27 14:34   ` [RFC v4 5/9] qemu-iotests: test new zone operations Stefan Hajnoczi
2022-07-27 14:59     ` Ming Lei
2022-07-27 15:12       ` Stefan Hajnoczi
2022-07-12  2:13 ` [RFC v4 6/9] raw-format: add " Sam Li
2022-07-27 14:39   ` Stefan Hajnoczi
2022-07-12  2:13 ` [RFC v4 7/9] config: add check to block layer Sam Li
2022-07-27 14:50   ` Stefan Hajnoczi
2022-07-12  2:13 ` [RFC v4 8/9] include: add support for zoned block devices Sam Li
2022-07-27 14:52   ` Stefan Hajnoczi
2022-07-12  2:13 ` [RFC v4 9/9] qapi: add support for zoned host device Sam Li
2022-07-12  7:48   ` Damien Le Moal
2022-07-27 14:53   ` Stefan Hajnoczi
2022-07-12  5:47 ` [RFC v4 0/9] Add support for zoned device Markus Armbruster
2022-07-12  5:59   ` Sam Li
2022-07-18 10:53     ` Markus Armbruster
2022-07-27 14:55 ` Stefan Hajnoczi
2022-07-27 15:06 ` Stefan Hajnoczi
2022-07-27 15:14   ` Sam Li

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=20220712021345.8530-6-faithilikerun@gmail.com \
    --to=faithilikerun@gmail.com \
    --cc=armbru@redhat.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=dmitry.fomichev@wdc.com \
    --cc=eblake@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.