All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/2] iotests: add 222 to test basic fleecing
Date: Thu, 28 Jun 2018 13:17:00 -0500	[thread overview]
Message-ID: <8a183b22-b934-13b9-f5ab-2d0c6bfbad77@redhat.com> (raw)
In-Reply-To: <20180628180042.3881-3-jsnow@redhat.com>

On 06/28/2018 01:00 PM, John Snow wrote:
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>   tests/qemu-iotests/222     | 149 +++++++++++++++++++++++++++++++++++++++++++++
>   tests/qemu-iotests/222.out |  60 ++++++++++++++++++
>   tests/qemu-iotests/group   |   1 +
>   3 files changed, 210 insertions(+)
>   create mode 100644 tests/qemu-iotests/222
>   create mode 100644 tests/qemu-iotests/222.out
> 

> +iotests.verify_platform(['linux'])
> +
> +patterns = [("0x5d", "0",         "64k"),
> +            ("0xd5", "1M",        "64k"),
> +            ("0xdc", "32M",       "64k"),
> +            ("0xcd", "0x3ff0000", "64k")]  # 64M - 64K
> +
> +overwrite = [("0xab", "0",         "64k"), # Full overwrite
> +             ("0xad", "0x00f8000", "64k"), # Partial-left (1M-32K)
> +             ("0x1d", "0x2008000", "64k"), # Partial-right (32M+32K)
> +             ("0xea", "0x3fe0000", "64k")] # Adjacent-left (64M - 128K)
> +
> +remainder = [("0xd5", "0x108000",  "32K"), # Right-end of partial-left [1]
> +             ("0xdc", "32M",       "32k"), # Left-end of partial-right [2]
> +             ("0xcd", "0x3ff0000", "64k")] # patterns[3]

What if you also add:

zeroes =  [("0x00", "0x108000",  "32K"), # Right-end of partial-left [1]
            ("0x00", "32M",       "32k"), # Left-end of partial-right [2]
            ("0x00", "0x3ff0000", "64k")] # patterns[3]

then...

> +    log('')
> +    log('--- Sanity Check ---')
> +    log('')
> +
> +    for p in patterns:

for p in (patterns + zeroes)

> +        cmd = "read -P%s %s %s" % p
> +        log(cmd)
> +        assert qemu_io_silent('-r', '-f', 'raw', '-c', cmd, nbd_uri) == 0
> +
> +    log('')
> +    log('--- Testing COW ---')
> +    log('')
> +
> +    for p in overwrite:
> +        cmd = "write -P%s %s %s" % p
> +        log(cmd)
> +        log(vm.hmp_qemu_io(srcNode, cmd))
> +
> +    log('')
> +    log('--- Verifying Data ---')
> +    log('')
> +
> +    for p in patterns:

for p in (patterns + zeroes)

> +        cmd = "read -P%s %s %s" % p
> +        log(cmd)
> +        assert qemu_io_silent('-r', '-f', 'raw', '-c', cmd, nbd_uri) == 0
> +
> +    log('')
> +    log('--- Cleanup ---')
> +    log('')
> +
> +    #log(vm.hmp_qemu_io(srcNode, 'flush'))
> +    log(vm.qmp('block-job-cancel', device=srcNode))
> +    log(vm.qmp('nbd-server-stop'))
> +    log(vm.qmp('blockdev-del', node_name=tgtNode))
> +    vm.shutdown()
> +
> +    log('')
> +    log('--- Confirming writes ---')
> +    log('')
> +
> +    for p in (overwrite + remainder):

so that reads of both the fleeced point in time and of the final image 
cover the same set of byte ranges.

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

  parent reply	other threads:[~2018-06-28 18:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28 18:00 [Qemu-devel] [PATCH v2 0/2] block: formalize and test fleecing John Snow
2018-06-28 18:00 ` [Qemu-devel] [PATCH v2 1/2] block: allow blockdev-backup from any source John Snow
2018-06-28 18:05   ` Eric Blake
2018-06-28 21:19     ` John Snow
2018-07-02  7:59       ` Kashyap Chamarthy
2018-07-02 18:13         ` John Snow
2018-06-28 18:00 ` [Qemu-devel] [PATCH v2 2/2] iotests: add 222 to test basic fleecing John Snow
2018-06-28 18:10   ` Eric Blake
2018-06-28 18:31     ` John Snow
2018-06-28 18:17   ` Eric Blake [this message]
2018-06-28 18:30     ` John Snow

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=8a183b22-b934-13b9-f5ab-2d0c6bfbad77@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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.