From: Hanna Reitz <hreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Emanuele Giuseppe Esposito <eesposit@redhat.com>,
Hanna Reitz <hreitz@redhat.com>,
qemu-devel@nongnu.org
Subject: [PATCH 5/5] iotests/296: Accept early failure
Date: Fri, 4 Mar 2022 16:37:29 +0100 [thread overview]
Message-ID: <20220304153729.711387-6-hreitz@redhat.com> (raw)
In-Reply-To: <20220304153729.711387-1-hreitz@redhat.com>
As of "crypto: perform permission checks under BQL", permission failures
occur early in the blockdev-amend job to update a LUKS volume's keys.
Expect them in x-blockdev-amend's QMP reply instead of waiting for the
actual job to fail later.
(Note that the job will still be created, so we need to wait for it to
disappear even when the QMP command failed. Otherwise, the job ID
"job0" will remain in use and we cannot launch another job with the same
ID.)
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
---
tests/qemu-iotests/296 | 8 ++++++--
tests/qemu-iotests/296.out | 17 +++++------------
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/tests/qemu-iotests/296 b/tests/qemu-iotests/296
index 099a3eeaa5..f80ef3434a 100755
--- a/tests/qemu-iotests/296
+++ b/tests/qemu-iotests/296
@@ -174,8 +174,12 @@ class EncryptionSetupTestCase(iotests.QMPTestCase):
}
result = vm.qmp('x-blockdev-amend', **args)
- assert result['return'] == {}
- vm.run_job('job0')
+ iotests.log(result)
+ # Run the job only if it was created
+ event = ('JOB_STATUS_CHANGE',
+ {'data': {'id': 'job0', 'status': 'created'}})
+ if vm.events_wait([event], timeout=0.0) is not None:
+ vm.run_job('job0')
# test that when the image opened by two qemu processes,
# neither of them can update the encryption keys
diff --git a/tests/qemu-iotests/296.out b/tests/qemu-iotests/296.out
index 42205cc981..609826eaa0 100644
--- a/tests/qemu-iotests/296.out
+++ b/tests/qemu-iotests/296.out
@@ -1,11 +1,9 @@
-{"execute": "job-dismiss", "arguments": {"id": "job0"}}
{"return": {}}
-Job failed: Failed to get shared "consistent read" lock
{"execute": "job-dismiss", "arguments": {"id": "job0"}}
{"return": {}}
-Job failed: Failed to get shared "consistent read" lock
-{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"error": {"class": "GenericError", "desc": "Failed to get shared \"consistent read\" lock"}}
+{"error": {"class": "GenericError", "desc": "Failed to get shared \"consistent read\" lock"}}
{"return": {}}
{"execute": "job-dismiss", "arguments": {"id": "job0"}}
{"return": {}}
@@ -13,14 +11,9 @@ qemu-img: Failed to get shared "consistent read" lock
Is another process using the image [TEST_DIR/test.img]?
.
-Job failed: Block node is read-only
-{"execute": "job-dismiss", "arguments": {"id": "job0"}}
-{"return": {}}
-Job failed: Failed to get shared "consistent read" lock
-{"execute": "job-dismiss", "arguments": {"id": "job0"}}
-{"return": {}}
-Job failed: Failed to get shared "consistent read" lock
-{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"error": {"class": "GenericError", "desc": "Block node is read-only"}}
+{"error": {"class": "GenericError", "desc": "Failed to get shared \"consistent read\" lock"}}
+{"error": {"class": "GenericError", "desc": "Failed to get shared \"consistent read\" lock"}}
{"return": {}}
{"execute": "job-dismiss", "arguments": {"id": "job0"}}
{"return": {}}
--
2.34.1
next prev parent reply other threads:[~2022-03-04 15:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-04 15:37 [PATCH 0/5] block/amend: Fix failures seen in iotest 296 Hanna Reitz
2022-03-04 15:37 ` [PATCH 1/5] block/amend: Clean up job on early failure Hanna Reitz
2022-03-04 15:37 ` [PATCH 2/5] block/amend: Always call .bdrv_amend_clean() Hanna Reitz
2022-03-04 15:37 ` [PATCH 3/5] block/crypto: Reset updating_keys on perm failure Hanna Reitz
2022-03-04 15:37 ` [PATCH 4/5] block/amend: Keep strong reference to BDS Hanna Reitz
2022-03-04 15:37 ` Hanna Reitz [this message]
2022-03-04 16:16 ` [PATCH 0/5] block/amend: Fix failures seen in iotest 296 Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220304153729.711387-6-hreitz@redhat.com \
--to=hreitz@redhat.com \
--cc=eesposit@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).