[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v13 19/19] qemu-iotests: Test the 'base-node' parame
From: |
Alberto Garcia |
Subject: |
[Qemu-block] [PATCH v13 19/19] qemu-iotests: Test the 'base-node' parameter of 'block-stream' |
Date: |
Fri, 28 Oct 2016 10:08:20 +0300 |
The block-stream command has traditionally used the 'base' parameter
to indicate the image to copy the data from. This test checks that the
'base-node' parameter can also be used for the same purpose.
Signed-off-by: Alberto Garcia <address@hidden>
---
tests/qemu-iotests/030 | 37 +++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/030.out | 4 ++--
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 783a1b8..54db54a 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -347,6 +347,43 @@ class TestParallelOps(iotests.QMPTestCase):
self.assert_no_active_block_jobs()
+ # Test the base_node parameter
+ def test_stream_base_node_name(self):
+ self.assert_no_active_block_jobs()
+
+ self.assertNotEqual(qemu_io('-f', iotests.imgfmt, '-c', 'map',
self.imgs[4]),
+ qemu_io('-f', iotests.imgfmt, '-c', 'map',
self.imgs[3]),
+ 'image file map matches backing file before
streaming')
+
+ # Error: the base node does not exist
+ result = self.vm.qmp('block-stream', device='node4', base_node='none',
job_id='stream')
+ self.assert_qmp(result, 'error/class', 'GenericError')
+
+ # Error: the base node is not a backing file of the top node
+ result = self.vm.qmp('block-stream', device='node4',
base_node='node6', job_id='stream')
+ self.assert_qmp(result, 'error/class', 'GenericError')
+
+ # Error: the base node is the same as the top node
+ result = self.vm.qmp('block-stream', device='node4',
base_node='node4', job_id='stream')
+ self.assert_qmp(result, 'error/class', 'GenericError')
+
+ # Error: cannot specify 'base' and 'base-node' at the same time
+ result = self.vm.qmp('block-stream', device='node4',
base=self.imgs[2], base_node='node2', job_id='stream')
+ self.assert_qmp(result, 'error/class', 'GenericError')
+
+ # Success: the base node is a backing file of the top node
+ result = self.vm.qmp('block-stream', device='node4',
base_node='node2', job_id='stream')
+ self.assert_qmp(result, 'return', {})
+
+ self.wait_until_completed(drive='stream')
+
+ self.assert_no_active_block_jobs()
+ self.vm.shutdown()
+
+ self.assertEqual(qemu_io('-f', iotests.imgfmt, '-c', 'map',
self.imgs[4]),
+ qemu_io('-f', iotests.imgfmt, '-c', 'map',
self.imgs[3]),
+ 'image file map matches backing file after streaming')
+
class TestQuorum(iotests.QMPTestCase):
num_children = 3
children = []
diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out
index c6a10f8..84bfd63 100644
--- a/tests/qemu-iotests/030.out
+++ b/tests/qemu-iotests/030.out
@@ -1,5 +1,5 @@
-.....................
+......................
----------------------------------------------------------------------
-Ran 21 tests
+Ran 22 tests
OK
--
2.9.3
- [Qemu-block] [PATCH v13 00/19] Support streaming to an intermediate layer, Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 05/19] block: Use block_job_add_bdrv() in backup_start(), Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 07/19] block: Block all nodes involved in the block-commit operation, Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 06/19] block: Check blockers in all nodes involved in a block-commit job, Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 02/19] block: Pause all jobs during bdrv_reopen_multiple(), Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 04/19] block: Use block_job_add_bdrv() in mirror_start_job(), Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 08/19] block: Block all intermediate nodes in commit_active_start(), Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 03/19] block: Add block_job_add_bdrv(), Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 19/19] qemu-iotests: Test the 'base-node' parameter of 'block-stream',
Alberto Garcia <=
- [Qemu-block] [PATCH v13 12/19] qemu-iotests: Test streaming to an intermediate layer, Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 15/19] qemu-iotests: Test block-stream and block-commit in parallel, Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 01/19] block: Add bdrv_drain_all_{begin, end}(), Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 11/19] docs: Document how to stream to an intermediate layer, Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 18/19] block: Add 'base-node' parameter to the 'block-stream' command, Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 10/19] block: Add QMP support for streaming to an intermediate layer, Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 16/19] qemu-iotests: Add iotests.supports_quorum(), Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 09/19] block: Support streaming to an intermediate layer, Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 17/19] qemu-iotests: Test streaming to a Quorum child, Alberto Garcia, 2016/10/28
- [Qemu-block] [PATCH v13 14/19] qemu-iotests: Test overlapping stream and commit operations, Alberto Garcia, 2016/10/28