[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 22/29] iotests: improve pause_job
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 22/29] iotests: improve pause_job |
Date: |
Mon, 11 Jun 2018 16:26:04 +0200 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
It's possible, that job was finished during waiting. In this case we
will see error message "Timeout waiting for job to pause" which is not
very informative. So, let's check during waiting iteration that the job
exists.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/iotests.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 0b204dc220..2f22fab2a7 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -590,9 +590,14 @@ class QMPTestCase(unittest.TestCase):
with Timeout(1, "Timeout waiting for job to pause"):
while True:
result = self.vm.qmp('query-block-jobs')
+ found = False
for job in result['return']:
- if job['device'] == job_id and job['paused'] == True and
job['busy'] == False:
- return job
+ if job['device'] == job_id:
+ found = True
+ if job['paused'] == True and job['busy'] == False:
+ return job
+ break
+ assert found
def pause_job(self, job_id='job0', wait=True):
result = self.vm.qmp('block-job-pause', device=job_id)
--
2.17.1
- [Qemu-block] [PULL 12/29] iotests: Repairing error during snapshot deletion, (continued)
- [Qemu-block] [PULL 12/29] iotests: Repairing error during snapshot deletion, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 15/29] qemu-io: Exit with error when a command failed, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 17/29] iotests: Let 216 make use of qemu-io's exit code, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 16/29] iotests.py: Add qemu_io_silent, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 18/29] qemu-img: Resolve relative backing paths in rebase, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 14/29] qemu-io: Let command functions return error code, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 13/29] qemu-io: Drop command functions' return values, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 20/29] qemu-img: Special post-backing convert handling, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 19/29] iotests: Add test for rebasing with relative paths, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 21/29] iotests: Test post-backing convert target behavior, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 22/29] iotests: improve pause_job,
Max Reitz <=
- [Qemu-block] [PULL 23/29] iotests: Fix 219's timing, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 26/29] throttle: Fix crash on reopen, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 25/29] block/qcow2-bitmap: fix free_bitmap_clusters, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 28/29] qcow2: Do not mark inactive images corrupt, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 24/29] qemu-img: Remove deprecated -s snapshot_id_or_name option, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 27/29] block: Make bdrv_is_writable() public, Max Reitz, 2018/06/11
- [Qemu-block] [PULL 29/29] iotests: Add case for a corrupted inactive image, Max Reitz, 2018/06/11
- Re: [Qemu-block] [PULL 00/29] Block patches, Peter Maydell, 2018/06/11