This patch adds some tests on how commit copes with filter nodes.
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/040 | 177 +++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/040.out | 4 +-
2 files changed, 179 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index 32c82b4ec6..e7fa244738 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -713,6 +713,183 @@ class TestErrorHandling(iotests.QMPTestCase):
self.assertTrue(iotests.compare_images(mid_img, backing_img,
fmt2='raw'),
'target image does not match source after commit')
+class TestCommitWithFilters(iotests.QMPTestCase):
+ img0 = os.path.join(iotests.test_dir, '0.img')
+ img1 = os.path.join(iotests.test_dir, '1.img')
+ img2 = os.path.join(iotests.test_dir, '2.img')
+ img3 = os.path.join(iotests.test_dir, '3.img')
+
+ def do_test_io(self, read_or_write):
+ for index, pattern_file in enumerate(self.pattern_files):
+ result = qemu_io('-f', iotests.imgfmt,
+ '-c', '{} -P {} {}M 1M'.format(read_or_write,
+ index + 1, index),