summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests/iotests.py
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-04-02 13:54:07 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2014-04-25 18:05:05 +0200
commit9974ad40bf36d605f1134b94e51fd53e9970f46a (patch)
treeb2ccb6c474bb1c78001dd396880305ec09d5faad /tests/qemu-iotests/iotests.py
parentd1db760d7be664c1345670637ba0c5accbf73710 (diff)
downloadhqemu-9974ad40bf36d605f1134b94e51fd53e9970f46a.zip
hqemu-9974ad40bf36d605f1134b94e51fd53e9970f46a.tar.gz
qemu-iotests: Improve and make use of QMPTestCase.wait_until_completed()
This eliminates code duplication. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r--tests/qemu-iotests/iotests.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index e4fa9af..f6c437c 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -257,7 +257,7 @@ class QMPTestCase(unittest.TestCase):
self.assert_no_active_block_jobs()
return result
- def wait_until_completed(self, drive='drive0'):
+ def wait_until_completed(self, drive='drive0', check_offset=True):
'''Wait for a block job to finish, returning the event'''
completed = False
while not completed:
@@ -265,7 +265,8 @@ class QMPTestCase(unittest.TestCase):
if event['event'] == 'BLOCK_JOB_COMPLETED':
self.assert_qmp(event, 'data/device', drive)
self.assert_qmp_absent(event, 'data/error')
- self.assert_qmp(event, 'data/offset', self.image_len)
+ if check_offset:
+ self.assert_qmp(event, 'data/offset', self.image_len)
self.assert_qmp(event, 'data/len', self.image_len)
completed = True
OpenPOWER on IntegriCloud