[PATCH 5/6] iotests: Support job-complete in run_job()

Kevin Wolf posted 6 patches 6 years, 2 months ago
There is a newer version of this series
[PATCH 5/6] iotests: Support job-complete in run_job()
Posted by Kevin Wolf 6 years, 2 months ago
Automatically complete jobs that have a 'ready' state and need an
explicit job-complete. Without this, run_job() would hang for such
jobs.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/iotests.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index b409198e47..c4063ef6bb 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -617,6 +617,8 @@ class VM(qtest.QEMUQtestMachine):
                         error = j['error']
                         if use_log:
                             log('Job failed: %s' % (j['error']))
+            elif status == 'ready':
+                self.qmp_log('job-complete', id=job)
             elif status == 'pending' and not auto_finalize:
                 if pre_finalize:
                     pre_finalize()
-- 
2.20.1


Re: [PATCH 5/6] iotests: Support job-complete in run_job()
Posted by Vladimir Sementsov-Ogievskiy 6 years, 2 months ago
20.11.2019 17:03, Kevin Wolf wrote:
> Automatically complete jobs that have a 'ready' state and need an
> explicit job-complete. Without this, run_job() would hang for such
> jobs.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

> ---
>   tests/qemu-iotests/iotests.py | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index b409198e47..c4063ef6bb 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -617,6 +617,8 @@ class VM(qtest.QEMUQtestMachine):
>                           error = j['error']
>                           if use_log:
>                               log('Job failed: %s' % (j['error']))
> +            elif status == 'ready':
> +                self.qmp_log('job-complete', id=job)
>               elif status == 'pending' and not auto_finalize:
>                   if pre_finalize:
>                       pre_finalize()
> 


-- 
Best regards,
Vladimir

Re: [PATCH 5/6] iotests: Support job-complete in run_job()
Posted by Eric Blake 6 years, 2 months ago
On 11/20/19 8:03 AM, Kevin Wolf wrote:
> Automatically complete jobs that have a 'ready' state and need an
> explicit job-complete. Without this, run_job() would hang for such
> jobs.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>   tests/qemu-iotests/iotests.py | 2 ++
>   1 file changed, 2 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index b409198e47..c4063ef6bb 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -617,6 +617,8 @@ class VM(qtest.QEMUQtestMachine):
>                           error = j['error']
>                           if use_log:
>                               log('Job failed: %s' % (j['error']))
> +            elif status == 'ready':
> +                self.qmp_log('job-complete', id=job)
>               elif status == 'pending' and not auto_finalize:
>                   if pre_finalize:
>                       pre_finalize()
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org