As the length of a mirror block job no longer directly depends on the size of the block device, drop those checks from this test. Instead, just check whether the final offset equals the block job length.
As 041 uses the wait_until_completed function from iotests.py, the same applies there as well which in turn affects tests 030, 055 and 056. On the other hand, a block job's length does not have to be related to the length of the image file in the first place, so that check was questionable anyway. Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- tests/qemu-iotests/040 | 4 +--- tests/qemu-iotests/041 | 3 +-- tests/qemu-iotests/iotests.py | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index 734b6a6..ca2b82e 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -46,13 +46,11 @@ class ImageCommitTestCase(iotests.QMPTestCase): if event['event'] == 'BLOCK_JOB_COMPLETED': self.assert_qmp(event, 'data/type', 'commit') self.assert_qmp(event, 'data/device', 'drive0') - self.assert_qmp(event, 'data/offset', self.image_len) - self.assert_qmp(event, 'data/len', self.image_len) + self.assert_qmp(event, 'data/offset', event['data']['len']) completed = True elif event['event'] == 'BLOCK_JOB_READY': self.assert_qmp(event, 'data/type', 'commit') self.assert_qmp(event, 'data/device', 'drive0') - self.assert_qmp(event, 'data/len', self.image_len) self.vm.qmp('block-job-complete', device='drive0') self.assert_no_active_block_jobs() diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index ec470b2..59b958b 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -46,8 +46,7 @@ class ImageMirroringTestCase(iotests.QMPTestCase): event = self.cancel_and_wait() self.assertEquals(event['event'], 'BLOCK_JOB_COMPLETED') self.assert_qmp(event, 'data/type', 'mirror') - self.assert_qmp(event, 'data/offset', self.image_len) - self.assert_qmp(event, 'data/len', self.image_len) + self.assert_qmp(event, 'data/offset', event['data']['len']) def complete_and_wait(self, drive='drive0', wait_ready=True): '''Complete a block job and wait for it to finish''' diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index f6c437c..ff474d4 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -266,8 +266,7 @@ class QMPTestCase(unittest.TestCase): self.assert_qmp(event, 'data/device', drive) self.assert_qmp_absent(event, 'data/error') if check_offset: - self.assert_qmp(event, 'data/offset', self.image_len) - self.assert_qmp(event, 'data/len', self.image_len) + self.assert_qmp(event, 'data/offset', event['data']['len']) completed = True self.assert_no_active_block_jobs() -- 2.0.0