Skip to content

Commit 4b914b0

Browse files
nirsebblake
authored andcommitted
iotests: Add more qemu_img helpers
Add 2 helpers for measuring and checking images: - qemu_img_measure() - qemu_img_check() Both use --output-json and parse the returned json to make easy to use in other tests. I'm going to use them in a new test, and I hope they will be useful in may other tests. Signed-off-by: Nir Soffer <[email protected]> Message-Id: <[email protected]> Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]> Signed-off-by: Eric Blake <[email protected]>
1 parent b7719bc commit 4b914b0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/qemu-iotests/iotests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ def qemu_img_create(*args):
141141

142142
return qemu_img(*args)
143143

144+
def qemu_img_measure(*args):
145+
return json.loads(qemu_img_pipe("measure", "--output", "json", *args))
146+
147+
def qemu_img_check(*args):
148+
return json.loads(qemu_img_pipe("check", "--output", "json", *args))
149+
144150
def qemu_img_verbose(*args):
145151
'''Run qemu-img without suppressing its output and return the exit code'''
146152
exitcode = subprocess.call(qemu_img_args + list(args))

0 commit comments

Comments
 (0)