summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests/041
diff options
context:
space:
mode:
authorKevin Wolf2018-04-30 19:09:46 +0200
committerKevin Wolf2018-05-23 14:30:51 +0200
commit1dac83f1a10c4c66858075970e199f4e4a8d8b71 (patch)
tree3bd1963ad8654e0644e09f2874a5caa2a15ae14c /tests/qemu-iotests/041
parentjob: Introduce qapi/job.json (diff)
downloadqemu-1dac83f1a10c4c66858075970e199f4e4a8d8b71.tar.gz
qemu-1dac83f1a10c4c66858075970e199f4e4a8d8b71.tar.xz
qemu-1dac83f1a10c4c66858075970e199f4e4a8d8b71.zip
job: Add JOB_STATUS_CHANGE QMP event
This adds a QMP event that is emitted whenever a job transitions from one status to another. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/041')
-rwxr-xr-xtests/qemu-iotests/04117
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index a860a31e9a..e94587950c 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -445,6 +445,8 @@ new_state = "1"
self.assert_qmp(event, 'data/device', 'drive0')
self.assert_qmp(event, 'data/error', 'Input/output error')
completed = True
+ elif event['event'] == 'JOB_STATUS_CHANGE':
+ self.assert_qmp(event, 'data/id', 'drive0')
self.assert_no_active_block_jobs()
self.vm.shutdown()
@@ -457,6 +459,10 @@ new_state = "1"
self.assert_qmp(result, 'return', {})
event = self.vm.get_qmp_event(wait=True)
+ while event['event'] == 'JOB_STATUS_CHANGE':
+ self.assert_qmp(event, 'data/id', 'drive0')
+ event = self.vm.get_qmp_event(wait=True)
+
self.assertEquals(event['event'], 'BLOCK_JOB_ERROR')
self.assert_qmp(event, 'data/device', 'drive0')
self.assert_qmp(event, 'data/operation', 'read')
@@ -478,6 +484,10 @@ new_state = "1"
self.assert_qmp(result, 'return', {})
event = self.vm.get_qmp_event(wait=True)
+ while event['event'] == 'JOB_STATUS_CHANGE':
+ self.assert_qmp(event, 'data/id', 'drive0')
+ event = self.vm.get_qmp_event(wait=True)
+
self.assertEquals(event['event'], 'BLOCK_JOB_ERROR')
self.assert_qmp(event, 'data/device', 'drive0')
self.assert_qmp(event, 'data/operation', 'read')
@@ -608,7 +618,7 @@ new_state = "1"
on_target_error='ignore')
self.assert_qmp(result, 'return', {})
- event = self.vm.get_qmp_event(wait=True)
+ event = self.vm.event_wait(name='BLOCK_JOB_ERROR')
self.assertEquals(event['event'], 'BLOCK_JOB_ERROR')
self.assert_qmp(event, 'data/device', 'drive0')
self.assert_qmp(event, 'data/operation', 'write')
@@ -784,7 +794,12 @@ class TestGranularity(iotests.QMPTestCase):
sync='full', target=target_img,
mode='absolute-paths', granularity=8192)
self.assert_qmp(result, 'return', {})
+
event = self.vm.get_qmp_event(wait=60.0)
+ while event['event'] == 'JOB_STATUS_CHANGE':
+ self.assert_qmp(event, 'data/id', 'drive0')
+ event = self.vm.get_qmp_event(wait=60.0)
+
# Failures will manifest as COMPLETED/ERROR.
self.assert_qmp(event, 'event', 'BLOCK_JOB_READY')
self.complete_and_wait(drive='drive0', wait_ready=False)