qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH v14 06/14] iotests: Omit length/offset test in 040 and 041
Date: Fri, 24 Oct 2014 15:57:35 +0200	[thread overview]
Message-ID: <1414159063-25977-7-git-send-email-mreitz@redhat.com> (raw)
In-Reply-To: <1414159063-25977-1-git-send-email-mreitz@redhat.com>

As of a follow-up patch to this one, the length of a mirror block job
will no longer directly depend on the size of the block device;
therefore, drop these 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 <mreitz@redhat.com>
---
 tests/qemu-iotests/040        | 4 +---
 tests/qemu-iotests/041        | 5 +----
 tests/qemu-iotests/iotests.py | 3 +--
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index f1e16c1..2b432ad 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -43,8 +43,7 @@ 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'])
                     if need_ready:
                         self.assertTrue(ready, "Expecting BLOCK_JOB_COMPLETED event")
                     completed = True
@@ -52,7 +51,6 @@ class ImageCommitTestCase(iotests.QMPTestCase):
                     ready = True
                     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 5dbd4ee..59a8f73 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -52,8 +52,7 @@ class ImageMirroringTestCase(iotests.QMPTestCase):
         event = self.cancel_and_wait(drive=drive)
         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'''
@@ -417,7 +416,6 @@ new_state = "1"
                     self.assert_qmp(event, 'data/type', 'mirror')
                     self.assert_qmp(event, 'data/device', 'drive0')
                     self.assert_qmp(event, 'data/error', 'Input/output error')
-                    self.assert_qmp(event, 'data/len', self.image_len)
                     completed = True
 
         self.assert_no_active_block_jobs()
@@ -568,7 +566,6 @@ new_state = "1"
                     self.assert_qmp(event, 'data/type', 'mirror')
                     self.assert_qmp(event, 'data/device', 'drive0')
                     self.assert_qmp(event, 'data/error', 'Input/output error')
-                    self.assert_qmp(event, 'data/len', self.image_len)
                     completed = True
 
         self.assert_no_active_block_jobs()
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 39a4cfc..f57f154 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -267,8 +267,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()
-- 
1.9.3

  parent reply	other threads:[~2014-10-24 13:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24 13:57 [Qemu-devel] [PATCH v14 00/14] qemu-img: Implement commit like QMP Max Reitz
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 01/14] qcow2: Allow "full" discard Max Reitz
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 02/14] qcow2: Implement bdrv_make_empty() Max Reitz
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 03/14] qcow2: Optimize bdrv_make_empty() Max Reitz
2014-10-24 14:33   ` Eric Blake
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 04/14] blockjob: Introduce block_job_complete_sync() Max Reitz
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 05/14] blockjob: Add "ready" field Max Reitz
2014-10-24 13:57 ` Max Reitz [this message]
2014-10-24 15:14   ` [Qemu-devel] [PATCH v14 06/14] iotests: Omit length/offset test in 040 and 041 Eric Blake
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 07/14] block/mirror: Improve progress report Max Reitz
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 08/14] qemu-img: Implement commit like QMP Max Reitz
2014-10-24 16:08   ` Eric Blake
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 09/14] qemu-img: Empty image after commit Max Reitz
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 10/14] qemu-img: Enable progress output for commit Max Reitz
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 11/14] qemu-img: Specify backing file " Max Reitz
2014-10-24 16:23   ` Eric Blake
2014-10-27  9:11     ` Max Reitz
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 12/14] iotests: Add _filter_qemu_img_map Max Reitz
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 13/14] iotests: Add test for backing-chain commits Max Reitz
2014-10-24 13:57 ` [Qemu-devel] [PATCH v14 14/14] iotests: Add test for qcow2's bdrv_make_empty Max Reitz
2014-10-24 16:31   ` Eric Blake
2014-10-27  8:06     ` Max Reitz
2014-10-27 15:44       ` Eric Blake
2014-10-28 10:38 ` [Qemu-devel] [PATCH v14 00/14] qemu-img: Implement commit like QMP Kevin Wolf
2014-10-29 10:25 ` Stefan Hajnoczi

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=1414159063-25977-7-git-send-email-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).