summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/056
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/056
parentd1db760d7be664c1345670637ba0c5accbf73710 (diff)
downloadqemu-9974ad40bf36d605f1134b94e51fd53e9970f46a.zip
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/056')
-rwxr-xr-xtests/qemu-iotests/0569
1 files changed, 1 insertions, 8 deletions
diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056
index 63893423cf..54e4bd0692 100755
--- a/tests/qemu-iotests/056
+++ b/tests/qemu-iotests/056
@@ -57,14 +57,7 @@ class TestSyncModesNoneAndTop(iotests.QMPTestCase):
format=iotests.imgfmt, target=target_img)
self.assert_qmp(result, 'return', {})
- # Custom completed check as we are not copying all data.
- completed = False
- while not completed:
- for event in self.vm.get_qmp_events(wait=True):
- if event['event'] == 'BLOCK_JOB_COMPLETED':
- self.assert_qmp(event, 'data/device', 'drive0')
- self.assert_qmp_absent(event, 'data/error')
- completed = True
+ self.wait_until_completed(check_offset=False)
self.assert_no_active_block_jobs()
self.vm.shutdown()