All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alberto Garcia <berto@igalia.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Max Reitz <mreitz@redhat.com>, Alberto Garcia <berto@igalia.com>
Subject: [Qemu-devel] [PATCH v13 12/19] qemu-iotests: Test streaming to an intermediate layer
Date: Fri, 28 Oct 2016 10:08:13 +0300	[thread overview]
Message-ID: <e1268e07e6f19f1796d951aba146a69c3127a884.1477638050.git.berto@igalia.com> (raw)
In-Reply-To: <cover.1477638050.git.berto@igalia.com>
In-Reply-To: <cover.1477638050.git.berto@igalia.com>

This adds test_stream_intermediate(), similar to test_stream() but
streams to the intermediate image instead.

Signed-off-by: Alberto Garcia <berto@igalia.com>
---
 tests/qemu-iotests/030     | 21 ++++++++++++++++++++-
 tests/qemu-iotests/030.out |  4 ++--
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 107049b..8b0212c 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -36,7 +36,7 @@ class TestSingleDrive(iotests.QMPTestCase):
         qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img)
         qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 512', backing_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 524288 512', mid_img)
-        self.vm = iotests.VM().add_drive("blkdebug::" + test_img)
+        self.vm = iotests.VM().add_drive("blkdebug::" + test_img, "backing.node-name=mid")
         self.vm.launch()
 
     def tearDown(self):
@@ -60,6 +60,25 @@ class TestSingleDrive(iotests.QMPTestCase):
                          qemu_io('-f', iotests.imgfmt, '-c', 'map', test_img),
                          'image file map does not match backing file after streaming')
 
+    def test_stream_intermediate(self):
+        self.assert_no_active_block_jobs()
+
+        self.assertNotEqual(qemu_io('-f', 'raw', '-c', 'map', backing_img),
+                            qemu_io('-f', iotests.imgfmt, '-c', 'map', mid_img),
+                            'image file map matches backing file before streaming')
+
+        result = self.vm.qmp('block-stream', device='mid', job_id='stream-mid')
+        self.assert_qmp(result, 'return', {})
+
+        self.wait_until_completed(drive='stream-mid')
+
+        self.assert_no_active_block_jobs()
+        self.vm.shutdown()
+
+        self.assertEqual(qemu_io('-f', 'raw', '-c', 'map', backing_img),
+                         qemu_io('-f', iotests.imgfmt, '-c', 'map', mid_img),
+                         'image file map does not match backing file after streaming')
+
     def test_stream_pause(self):
         self.assert_no_active_block_jobs()
 
diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out
index 6323079..96961ed 100644
--- a/tests/qemu-iotests/030.out
+++ b/tests/qemu-iotests/030.out
@@ -1,5 +1,5 @@
-..............
+...............
 ----------------------------------------------------------------------
-Ran 14 tests
+Ran 15 tests
 
 OK
-- 
2.9.3

  parent reply	other threads:[~2016-10-28  7:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28  7:08 [Qemu-devel] [PATCH v13 00/19] Support streaming to an intermediate layer Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 01/19] block: Add bdrv_drain_all_{begin, end}() Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 02/19] block: Pause all jobs during bdrv_reopen_multiple() Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 03/19] block: Add block_job_add_bdrv() Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 04/19] block: Use block_job_add_bdrv() in mirror_start_job() Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 05/19] block: Use block_job_add_bdrv() in backup_start() Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 06/19] block: Check blockers in all nodes involved in a block-commit job Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 07/19] block: Block all nodes involved in the block-commit operation Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 08/19] block: Block all intermediate nodes in commit_active_start() Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 09/19] block: Support streaming to an intermediate layer Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 10/19] block: Add QMP support for " Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 11/19] docs: Document how to stream " Alberto Garcia
2016-10-28  7:08 ` Alberto Garcia [this message]
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 13/19] qemu-iotests: Test block-stream operations in parallel Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 14/19] qemu-iotests: Test overlapping stream and commit operations Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 15/19] qemu-iotests: Test block-stream and block-commit in parallel Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 16/19] qemu-iotests: Add iotests.supports_quorum() Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 17/19] qemu-iotests: Test streaming to a Quorum child Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 18/19] block: Add 'base-node' parameter to the 'block-stream' command Alberto Garcia
2016-10-28  7:08 ` [Qemu-devel] [PATCH v13 19/19] qemu-iotests: Test the 'base-node' parameter of 'block-stream' Alberto Garcia
2016-10-28 10:50 ` [Qemu-devel] [PATCH v13 00/19] Support streaming to an intermediate layer Kevin Wolf

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=e1268e07e6f19f1796d951aba146a69c3127a884.1477638050.git.berto@igalia.com \
    --to=berto@igalia.com \
    --cc=armbru@redhat.com \
    --cc=eblake@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.