[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v5 38/42] iotests: Let complete_and_wait() work with
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH v5 38/42] iotests: Let complete_and_wait() work with commit |
Date: |
Thu, 13 Jun 2019 00:10:00 +0200 |
complete_and_wait() and wait_ready() currently only work for mirror
jobs. Let them work for active commit jobs, too.
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/iotests.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index dc77d3fba0..55066d62bb 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -697,8 +697,12 @@ class QMPTestCase(unittest.TestCase):
def wait_ready(self, drive='drive0'):
'''Wait until a block job BLOCK_JOB_READY event'''
- f = {'data': {'type': 'mirror', 'device': drive } }
- event = self.vm.event_wait(name='BLOCK_JOB_READY', match=f)
+ event = self.vm.events_wait([
+ ('BLOCK_JOB_READY',
+ {'data': {'type': 'mirror', 'device': drive } }),
+ ('BLOCK_JOB_READY',
+ {'data': {'type': 'commit', 'device': drive } })
+ ])
def wait_ready_and_cancel(self, drive='drive0'):
self.wait_ready(drive=drive)
@@ -716,7 +720,7 @@ class QMPTestCase(unittest.TestCase):
self.assert_qmp(result, 'return', {})
event = self.wait_until_completed(drive=drive)
- self.assert_qmp(event, 'data/type', 'mirror')
+ self.assertTrue(event['data']['type'] in ['mirror', 'commit'])
def pause_wait(self, job_id='job0'):
with Timeout(1, "Timeout waiting for job to pause"):
--
2.21.0
- Re: [Qemu-block] [PATCH v5 30/42] qemu-img: Use child access functions, (continued)
[Qemu-block] [PATCH v5 35/42] block: Fix check_to_replace_node(), Max Reitz, 2019/06/12
[Qemu-block] [PATCH v5 34/42] block: Inline bdrv_co_block_status_from_*(), Max Reitz, 2019/06/12
[Qemu-block] [PATCH v5 36/42] iotests: Add tests for mirror @replaces loops, Max Reitz, 2019/06/12
[Qemu-block] [PATCH v5 38/42] iotests: Let complete_and_wait() work with commit,
Max Reitz <=
[Qemu-block] [PATCH v5 39/42] iotests: Add filter commit test cases, Max Reitz, 2019/06/12
[Qemu-block] [PATCH v5 37/42] block: Leave BDS.backing_file constant, Max Reitz, 2019/06/12
[Qemu-block] [PATCH v5 40/42] iotests: Add filter mirror test cases, Max Reitz, 2019/06/12
[Qemu-block] [PATCH v5 41/42] iotests: Add test for commit in sub directory, Max Reitz, 2019/06/12
[Qemu-block] [PATCH v5 42/42] iotests: Test committing to overridden backing, Max Reitz, 2019/06/12
Re: [Qemu-block] [PATCH v5 00/42] block: Deal with filters, Vladimir Sementsov-Ogievskiy, 2019/06/13