[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/47] qemu-iotests: Test 0-length image for mirror
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 04/47] qemu-iotests: Test 0-length image for mirror |
Date: |
Fri, 27 Jun 2014 21:08:23 +0200 |
From: Fam Zheng <address@hidden>
All behavior and invariant should hold for images with 0 length, so
add a class to repeat all the tests in TestSingleDrive.
Hide two unapplicable test methods that would fail with 0 image length
because it's also used as cluster size.
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/041 | 11 ++++++++---
tests/qemu-iotests/041.out | 4 ++--
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index ec470b2..ef4f465 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -64,7 +64,7 @@ class TestSingleDrive(ImageMirroringTestCase):
image_len = 1 * 1024 * 1024 # MB
def setUp(self):
- iotests.create_image(backing_img, TestSingleDrive.image_len)
+ iotests.create_image(backing_img, self.image_len)
qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' %
backing_img, test_img)
self.vm = iotests.VM().add_drive(test_img)
self.vm.launch()
@@ -163,7 +163,7 @@ class TestSingleDrive(ImageMirroringTestCase):
self.assert_no_active_block_jobs()
qemu_img('create', '-f', iotests.imgfmt, '-o',
'cluster_size=%d,size=%d'
- % (TestSingleDrive.image_len,
TestSingleDrive.image_len), target_img)
+ % (self.image_len, self.image_len), target_img)
result = self.vm.qmp('drive-mirror', device='drive0', sync='full',
buf_size=65536, mode='existing',
target=target_img)
self.assert_qmp(result, 'return', {})
@@ -179,7 +179,7 @@ class TestSingleDrive(ImageMirroringTestCase):
self.assert_no_active_block_jobs()
qemu_img('create', '-f', iotests.imgfmt, '-o',
'cluster_size=%d,backing_file=%s'
- % (TestSingleDrive.image_len, backing_img), target_img)
+ % (self.image_len, backing_img), target_img)
result = self.vm.qmp('drive-mirror', device='drive0', sync='full',
mode='existing', target=target_img)
self.assert_qmp(result, 'return', {})
@@ -206,6 +206,11 @@ class TestSingleDrive(ImageMirroringTestCase):
target=target_img)
self.assert_qmp(result, 'error/class', 'DeviceNotFound')
+class TestSingleDriveZeroLength(TestSingleDrive):
+ image_len = 0
+ test_small_buffer2 = None
+ test_large_cluster = None
+
class TestMirrorNoBacking(ImageMirroringTestCase):
image_len = 2 * 1024 * 1024 # MB
diff --git a/tests/qemu-iotests/041.out b/tests/qemu-iotests/041.out
index 6d9bee1..cfa5c0d 100644
--- a/tests/qemu-iotests/041.out
+++ b/tests/qemu-iotests/041.out
@@ -1,5 +1,5 @@
-...........................
+...................................
----------------------------------------------------------------------
-Ran 27 tests
+Ran 35 tests
OK
--
1.8.3.1
- [Qemu-devel] [PULL 00/47] Block patches for 2.1.0-rc0, Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 01/47] blockjob: Add block_job_yield(), Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 02/47] mirror: Go through ready -> complete process for 0 len image, Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 06/47] block/nfs: add knob to set readahead, Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 05/47] block/nfs: fix url parameter checking, Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 03/47] qemu-iotests: Test BLOCK_JOB_READY event for 0Kb image active commit, Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 04/47] qemu-iotests: Test 0-length image for mirror,
Kevin Wolf <=
- [Qemu-devel] [PULL 08/47] block: Move bdrv_fill_options() call to bdrv_open(), Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 07/47] block: Create bdrv_fill_options(), Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 09/47] block: Move json: parsing to bdrv_fill_options(), Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 11/47] block: Use common driver selection code for bdrv_open_file(), Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 12/47] block: Inline bdrv_file_open(), Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 10/47] block: Always pass driver name through options QDict, Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 13/47] block: Remove second bdrv_open() recursion, Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 14/47] block: Catch backing files assigned to non-COW drivers, Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 18/47] block: add qemu-iotest for resize base during live commit, Kevin Wolf, 2014/06/27
- [Qemu-devel] [PULL 16/47] qemu_opts_append: Play nicely with QemuOptsList's head, Kevin Wolf, 2014/06/27