aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/291
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qemu-iotests/291')
-rwxr-xr-xtests/qemu-iotests/29114
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/qemu-iotests/291 b/tests/qemu-iotests/291
index 4f837b2..77fa38f 100755
--- a/tests/qemu-iotests/291
+++ b/tests/qemu-iotests/291
@@ -42,6 +42,14 @@ _require_command QEMU_NBD
# compat=0.10 does not support bitmaps
_unsupported_imgopts 'compat=0.10'
+# Filter irrelevant format-specific information from the qemu-img info
+# output (we only want the bitmaps, basically)
+_filter_irrelevant_img_info()
+{
+ grep -v -e 'compat' -e 'compression type' -e 'data file' -e 'extended l2' \
+ -e 'lazy refcounts' -e 'refcount bits'
+}
+
echo
echo "=== Initial image setup ==="
echo
@@ -79,7 +87,7 @@ echo
# Only bitmaps from the active layer are copied
$QEMU_IMG convert --bitmaps -O qcow2 "$TEST_IMG.orig" "$TEST_IMG"
-_img_info --format-specific
+_img_info --format-specific | _filter_irrelevant_img_info
# But we can also merge in bitmaps from other layers. This test is a bit
# contrived to cover more code paths, in reality, you could merge directly
# into b0 without going through tmp
@@ -89,7 +97,7 @@ $QEMU_IMG bitmap --add --merge b0 -b "$TEST_IMG.base" -F $IMGFMT \
$QEMU_IMG bitmap --merge tmp -f $IMGFMT "$TEST_IMG" b0
$QEMU_IMG bitmap --remove --image-opts \
driver=$IMGFMT,file.driver=file,file.filename="$TEST_IMG" tmp
-_img_info --format-specific
+_img_info --format-specific | _filter_irrelevant_img_info
echo
echo "=== Merge from top layer into backing image ==="
@@ -98,7 +106,7 @@ echo
$QEMU_IMG rebase -u -F qcow2 -b "$TEST_IMG.base" "$TEST_IMG"
$QEMU_IMG bitmap --add --merge b2 -b "$TEST_IMG" -F $IMGFMT \
-f $IMGFMT "$TEST_IMG.base" b3
-_img_info --format-specific --backing-chain
+_img_info --format-specific --backing-chain | _filter_irrelevant_img_info
echo
echo "=== Check bitmap contents ==="