summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/iotests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r--tests/qemu-iotests/iotests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index bc9c71b979..733b82b42b 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -51,6 +51,11 @@ def qemu_io(*args):
args = qemu_io_args + list(args)
return subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0]
+def compare_images(img1, img2):
+ '''Return True if two image files are identical'''
+ return qemu_img('compare', '-f', imgfmt,
+ '-F', imgfmt, img1, img2) == 0
+
class VM(object):
'''A QEMU VM'''