[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 9/9] iotests: new test 206 for NBD BLOCK_STATUS

From: Eric Blake
Subject: Re: [Qemu-block] [PATCH 9/9] iotests: new test 206 for NBD BLOCK_STATUS
Date: Fri, 16 Feb 2018 15:02:15 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 02/15/2018 07:51 AM, Vladimir Sementsov-Ogievskiy wrote:
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
  tests/qemu-iotests/206     | 34 ++++++++++++++++++++++++++++++++++
  tests/qemu-iotests/206.out |  2 ++
  tests/qemu-iotests/group   |  1 +
  3 files changed, 37 insertions(+)
  create mode 100644 tests/qemu-iotests/206
  create mode 100644 tests/qemu-iotests/206.out

It's a race! Kevin already has test 206 and 207 claimed in his pending series:
Whoever loses gets to rebase and renumber (or the maintainer on their behalf) ;)

diff --git a/tests/qemu-iotests/206 b/tests/qemu-iotests/206
new file mode 100644

Oops, you forgot to mark this executable. And oops, I forgot to flag that on test 205. Other inconsistent tests: 096, 124, 129, 132, 136, 139, 148, 152, 163. Separate cleanup patch coming up soon.

index 0000000000..259e991ec6
--- /dev/null
+++ b/tests/qemu-iotests/206
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+# Tests for NBD BLOCK_STATUS extension

+import iotests
+from iotests import qemu_img_create, qemu_io, qemu_img_verbose, qemu_nbd, \
+                    file_path

Don't we also need to blacklist v2 files (and only operate on v3 or newer), since the behavior of zero clusters is much worse on v2 images?

+disk, nbd_sock = file_path('disk', 'nbd-sock')
+nbd_uri = 'nbd+unix:///exp?socket=' + nbd_sock
+qemu_img_create('-f', iotests.imgfmt, disk, '1M')
+qemu_io('-f', iotests.imgfmt, '-c', 'write 0 512K', disk)

Hopefully large enough for all the major filesystems with sparse support to show half-data, half-hole, and not run into any weird issues where granularity differences between filesystems change the outcome.

+qemu_nbd('-k', nbd_sock, '-x', 'exp', '-f', iotests.imgfmt, disk)
+qemu_img_verbose('map', '-f', 'raw', '--output=json', nbd_uri)
diff --git a/tests/qemu-iotests/206.out b/tests/qemu-iotests/206.out
new file mode 100644
index 0000000000..0d29724e84
--- /dev/null
+++ b/tests/qemu-iotests/206.out
@@ -0,0 +1,2 @@
+[{ "start": 0, "length": 524288, "depth": 0, "zero": false, "data": true},
+{ "start": 524288, "length": 524288, "depth": 0, "zero": true, "data": false}]

But definite evidence of getting block status over NBD! Progress!

And kudos for producing an .out file that I can actually read and reproduce without the aid of python (in contrast to the more "unit-test"-y ones like 205, where we had a big long side-discussion about that. No need to repeat it here).

diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index a2dfe79d86..2c3925566a 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -202,3 +202,4 @@
  203 rw auto
  204 rw auto quick
  205 rw auto quick
+206 rw auto quick

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]