yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
902636
From bb7b968a02c97564596b73d8d080cd745d96ed6b Mon Sep 17 00:00:00 2001
902636
From: Kevin Wolf <kwolf@redhat.com>
902636
Date: Fri, 13 Mar 2020 12:34:35 +0000
902636
Subject: [PATCH 15/20] iotests: Fix run_job() with use_log=False
902636
902636
RH-Author: Kevin Wolf <kwolf@redhat.com>
902636
Message-id: <20200313123439.10548-10-kwolf@redhat.com>
902636
Patchwork-id: 94284
902636
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH v2 09/13] iotests: Fix run_job() with use_log=False
902636
Bugzilla: 1790482 1805143
902636
RH-Acked-by: John Snow <jsnow@redhat.com>
902636
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
902636
RH-Acked-by: Peter Krempa <pkrempa@redhat.com>
902636
902636
The 'job-complete' QMP command should be run with qmp() rather than
902636
qmp_log() if use_log=False is passed.
902636
902636
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
902636
Message-Id: <20200310113831.27293-4-kwolf@redhat.com>
902636
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
902636
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
902636
(cherry picked from commit b31b532122ec6f68d17168449c034d2197bf96ec)
902636
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
902636
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
902636
---
902636
 tests/qemu-iotests/iotests.py | 5 ++++-
902636
 1 file changed, 4 insertions(+), 1 deletion(-)
902636
902636
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
902636
index 0c55f7b..46f880c 100644
902636
--- a/tests/qemu-iotests/iotests.py
902636
+++ b/tests/qemu-iotests/iotests.py
902636
@@ -618,7 +618,10 @@ class VM(qtest.QEMUQtestMachine):
902636
                         if use_log:
902636
                             log('Job failed: %s' % (j['error']))
902636
             elif status == 'ready':
902636
-                self.qmp_log('job-complete', id=job)
902636
+                if use_log:
902636
+                    self.qmp_log('job-complete', id=job)
902636
+                else:
902636
+                    self.qmp('job-complete', id=job)
902636
             elif status == 'pending' and not auto_finalize:
902636
                 if pre_finalize:
902636
                     pre_finalize()
902636
-- 
902636
1.8.3.1
902636