diff options
author | John Snow <jsnow@redhat.com> | 2022-03-21 16:16:10 -0400 |
---|---|---|
committer | Hanna Reitz <hreitz@redhat.com> | 2022-03-22 10:14:34 +0100 |
commit | 1670ae7af668958e76be6749f1f729d6dc9861e9 (patch) | |
tree | 09f439af49b7a078bfe58956405d8414238f32f2 /tests/qemu-iotests/211 | |
parent | ac5bb4861c233c9483d89dff7ef0fa6f799ca1e7 (diff) |
iotests: add qemu_img_map() function
Add a qemu_img_map() function by analogy with qemu_img_measure(),
qemu_img_check(), and qemu_img_info() that all return JSON information.
Replace calls to qemu_img_pipe('map', '--output=json', ...) with this
new function, which provides better diagnostic information on failure.
Note: The output for iotest 211 changes, because logging JSON after it
was deserialized by Python behaves a little differently than logging the
raw JSON document string itself.
(iotests.log() sorts the keys for Python 3.6 support.)
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20220321201618.903471-11-jsnow@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/211')
-rwxr-xr-x | tests/qemu-iotests/211 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/qemu-iotests/211 b/tests/qemu-iotests/211 index f52cadade1..1a3b4596c8 100755 --- a/tests/qemu-iotests/211 +++ b/tests/qemu-iotests/211 @@ -59,7 +59,7 @@ with iotests.FilePath('t.vdi') as disk_path, \ vm.shutdown() iotests.img_info_log(disk_path) - iotests.log(iotests.qemu_img_pipe('map', '--output=json', disk_path)) + iotests.log(iotests.qemu_img_map(disk_path)) # # Successful image creation (explicit defaults) @@ -83,7 +83,7 @@ with iotests.FilePath('t.vdi') as disk_path, \ vm.shutdown() iotests.img_info_log(disk_path) - iotests.log(iotests.qemu_img_pipe('map', '--output=json', disk_path)) + iotests.log(iotests.qemu_img_map(disk_path)) # # Successful image creation (with non-default options) @@ -107,7 +107,7 @@ with iotests.FilePath('t.vdi') as disk_path, \ vm.shutdown() iotests.img_info_log(disk_path) - iotests.log(iotests.qemu_img_pipe('map', '--output=json', disk_path)) + iotests.log(iotests.qemu_img_map(disk_path)) # # Invalid BlockdevRef |