iotests: add qemu_img_map() function
authorJohn Snow <jsnow@redhat.com>
Mon, 21 Mar 2022 20:16:10 +0000 (16:16 -0400)
committerHanna Reitz <hreitz@redhat.com>
Tue, 22 Mar 2022 09:14:34 +0000 (10:14 +0100)
commit1670ae7af668958e76be6749f1f729d6dc9861e9
tree09f439af49b7a078bfe58956405d8414238f32f2
parentac5bb4861c233c9483d89dff7ef0fa6f799ca1e7
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>
tests/qemu-iotests/041
tests/qemu-iotests/211
tests/qemu-iotests/211.out
tests/qemu-iotests/iotests.py
tests/qemu-iotests/tests/block-status-cache
tests/qemu-iotests/tests/parallels-read-bitmap