qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 4/4] iotests: Add tests for the x-blockdev-del command
Date: Sat, 31 Oct 2015 20:28:35 +0100	[thread overview]
Message-ID: <56351663.7000908@redhat.com> (raw)
In-Reply-To: <6ace4d33d6a0cd429e851abf38713dfaf32a6136.1445600995.git.berto@igalia.com>

[-- Attachment #1: Type: text/plain, Size: 4038 bytes --]

On 23.10.2015 14:03, Alberto Garcia wrote:
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>  tests/qemu-iotests/139     | 408 +++++++++++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/139.out |   5 +
>  tests/qemu-iotests/group   |   1 +
>  3 files changed, 414 insertions(+)
>  create mode 100644 tests/qemu-iotests/139
>  create mode 100644 tests/qemu-iotests/139.out
> 
> diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
> new file mode 100644
> index 0000000..f38f7e4
> --- /dev/null
> +++ b/tests/qemu-iotests/139
> @@ -0,0 +1,408 @@

[...]

> +
> +    # Add a BlockDriverState that has base_img as its backing file

Not quite; while new_img does have base_img as its backing file,
new_img's format BDS explicitly does not.

> +    def addBlockDriverStateOverlay(self, node):
> +        self.checkBlockDriverState(node, False)
> +        iotests.qemu_img('create', '-f', iotests.imgfmt,
> +                         '-b', base_img, new_img, '1M')
> +        opts = {'driver': iotests.imgfmt,
> +                'node-name': node,
> +                'backing': '',
> +                'file': {'driver': 'file',
> +                         'filename': new_img}}
> +        result = self.vm.qmp('blockdev-add', conv_keys = False, options = opts)
> +        self.assert_qmp(result, 'return', {})
> +        self.checkBlockDriverState(node)

[...]

> +    # Add a BlkDebug node
> +    def addBlkDebug(self, debug, node):
> +        self.checkBlockDriverState(node, False)
> +        self.checkBlockDriverState(debug, False)
> +        image = {'driver': iotests.imgfmt,
> +                 'node-name': node,
> +                 'file': {'driver': 'file',
> +                          'filename': base_img}}
> +        opts = {'driver': 'blkdebug',
> +                'node-name': debug,
> +                'image': image}

Normally, blkdebug is supposed to sit between the format and the
protocol BDS.

(You can either make this a test of "raw" instead of "blkdebug", amend
the blkdebug placement, or simply ignore how it's "normally supposed to
be".)

> +        result = self.vm.qmp('blockdev-add', conv_keys = False, options = opts)
> +        self.assert_qmp(result, 'return', {})
> +        self.checkBlockDriverState(node)
> +        self.checkBlockDriverState(debug)
> +
> +    # Add a BlkVerify node
> +    def addBlkVerify(self, blkverify, test, raw):
> +        self.checkBlockDriverState(test, False)
> +        self.checkBlockDriverState(raw, False)
> +        self.checkBlockDriverState(blkverify, False)
> +        iotests.qemu_img('create', '-f', iotests.imgfmt, new_img, '1M')
> +        node_0 = {'driver': iotests.imgfmt,
> +                  'node-name': test,
> +                  'file': {'driver': 'file',
> +                           'filename': base_img}}
> +        node_1 = {'driver': iotests.imgfmt,
> +                  'node-name': raw,
> +                  'file': {'driver': 'file',
> +                           'filename': new_img}}

And, well, this is normally supposed to be a protocol BDS. The use case
of blkverify is not to be a dumbed-down quorum, but to test the block
driver used for the test node.

(Here, your choices are either to drop this test, or again to ignore how
it's normally supposed to be.)

> +        opts = {'driver': 'blkverify',
> +                'node-name': blkverify,
> +                'test': node_0,
> +                'raw': node_1}
> +        result = self.vm.qmp('blockdev-add', conv_keys = False, options = opts)
> +        self.assert_qmp(result, 'return', {})
> +        self.checkBlockDriverState(test)
> +        self.checkBlockDriverState(raw)
> +        self.checkBlockDriverState(blkverify)

Assuming you choose the "ignore" option for both of the above, and you
do something about the *Overlay comment or I simply accept it as "not
that wrong, and it's just a comment in a test":

Reviewed-by: Max Reitz <mreitz@redhat.com>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2015-10-31 19:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 12:03 [Qemu-devel] [PATCH v3 0/4] Add 'x-blockdev-del' command Alberto Garcia
2015-10-23 12:03 ` [Qemu-devel] [PATCH v3 1/4] mirror: block all operations on the target image during the job Alberto Garcia
2015-10-31 17:32   ` Max Reitz
2015-10-23 12:03 ` [Qemu-devel] [PATCH v3 2/4] block: Add blk_get_refcnt() Alberto Garcia
2015-10-23 12:03 ` [Qemu-devel] [PATCH v3 3/4] block: Add 'x-blockdev-del' QMP command Alberto Garcia
2015-10-31 18:01   ` Max Reitz
2015-10-23 12:03 ` [Qemu-devel] [PATCH v3 4/4] iotests: Add tests for the x-blockdev-del command Alberto Garcia
2015-10-31 19:28   ` Max Reitz [this message]

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=56351663.7000908@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.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).