[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 05/12] iotests/040: Fix TestCommitWithFilters test
From: |
John Snow |
Subject: |
[PATCH v3 05/12] iotests/040: Fix TestCommitWithFilters test |
Date: |
Mon, 18 Apr 2022 17:14:57 -0400 |
Without this change, asserting that qemu_io always returns 0 causes this
test to fail in a way we happened not to be catching previously:
qemu.utils.VerboseProcessError: Command
'('/home/jsnow/src/qemu/bin/git/tests/qemu-iotests/../../qemu-io',
'--cache', 'writeback', '--aio', 'threads', '-f', 'qcow2', '-c',
'read -P 4 3M 1M',
'/home/jsnow/src/qemu/bin/git/tests/qemu-iotests/scratch/3.img')'
returned non-zero exit status 1.
┏━ output ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┃ qemu-io: can't open device
┃ /home/jsnow/src/qemu/bin/git/tests/qemu-iotests/scratch/3.img:
┃ Could not open backing file: Could not open backing file: Throttle
┃ group 'tg' does not exist
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The commit jobs changes the backing file string stored in the image file
header belonging to the node above the commit’s top node to point to the
commit target (the base node). QEMU tries to be as accurate as
possible, and so in these test cases will include the filter that is
part of the block graph in that backing file string (by virtue of making
it a json:{} description of the post-commit subgraph). This makes
little sense outside of QEMU, though: Specifically, the throttle node in
that subgraph will dearly miss its supposedly associated throttle group
object.
When starting the commit job, we can specify a custom backing file
string to write into said image file, so let’s use that feature to write
the plain filename of the backing chain’s next actual image file there.
Explicitly provide the backing file so that opening the file outside of
QEMU (Where we will not have throttle groups) will succeed.
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
tests/qemu-iotests/040 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index c4a90937dcb..30eb97829ea 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -836,7 +836,8 @@ class TestCommitWithFilters(iotests.QMPTestCase):
job_id='commit',
device='top-filter',
top_node='cow-2',
- base_node='cow-1')
+ base_node='cow-1',
+ backing_file=self.img1)
self.assert_qmp(result, 'return', {})
self.wait_until_completed(drive='commit')
@@ -852,7 +853,8 @@ class TestCommitWithFilters(iotests.QMPTestCase):
job_id='commit',
device='top-filter',
top_node='cow-1',
- base_node='cow-0')
+ base_node='cow-0',
+ backing_file=self.img0)
self.assert_qmp(result, 'return', {})
self.wait_until_completed(drive='commit')
--
2.34.1
- [PATCH v3 00/12] iotests: add enhanced debugging info to qemu-io failures, John Snow, 2022/04/18
- [PATCH v3 06/12] iotests: create generic qemu_tool() function, John Snow, 2022/04/18
- [PATCH v3 02/12] iotests/163: Fix broken qemu-io invocation, John Snow, 2022/04/18
- [PATCH v3 01/12] iotests: replace calls to log(qemu_io(...)) with qemu_io_log(), John Snow, 2022/04/18
- [PATCH v3 05/12] iotests/040: Fix TestCommitWithFilters test,
John Snow <=
- [PATCH v3 11/12] iotests: remove qemu_io_silent() and qemu_io_silent_check()., John Snow, 2022/04/18
- [PATCH v3 03/12] iotests: Don't check qemu_io() output for specific error strings, John Snow, 2022/04/18
- [PATCH v3 08/12] iotests/migration-permissions: use assertRaises() for qemu_io() negative test, John Snow, 2022/04/18
- [PATCH v3 12/12] iotests: make qemu_io_log() check return codes by default, John Snow, 2022/04/18
- [PATCH v3 04/12] iotests/040: Don't check image pattern on zero-length image, John Snow, 2022/04/18
- [PATCH v3 09/12] iotests/image-fleecing: switch to qemu_io(), John Snow, 2022/04/18
- [PATCH v3 07/12] iotests: rebase qemu_io() on top of qemu_tool(), John Snow, 2022/04/18
- [PATCH v3 10/12] iotests: remove qemu_io_pipe_and_status(), John Snow, 2022/04/18
- Re: [PATCH v3 00/12] iotests: add enhanced debugging info to qemu-io failures, Hanna Reitz, 2022/04/25