Skip to contentSkip to conversation

iotests/279: Fix for non-qcow2 formats

PATCH Applied Max Reitz 3 participants 4 messages Dec 19, 2019 – Feb 19, 2020

lore
Share & tools
lore

Max Reitz

author
#0 lore raw

PATCH 1/1 iotests/279: Fix for non-qcow2 formats

First, driver=qcow2 will not work so well with non-qcow2 formats (and this test claims to support qcow, qed, and vmdk).

Second, vmdk will always report the backing file format to be vmdk. Filter that out so the output looks like for all other formats.

Third, the flat vmdk subformats do not support backing files, so they will not work with this test.

---
 tests/qemu-iotests/279 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tests/qemu-iotests/279 +5 -2
index 6682376808..30d29b1cb2 100755
@@ -38,6 +38,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto file
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" \
+                     "subformat=twoGbMaxExtentFlat" \
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
 TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base"
@@ -45,11 +47,12 @@ _make_test_img -b "$TEST_IMG.mid"
 
 echo
 echo '== qemu-img info --backing-chain =='
-_img_info --backing-chain | _filter_img_info
+_img_info --backing-chain | _filter_img_info | grep -v 'backing file format'
 
 echo
 echo '== qemu-img info --backing-chain --image-opts =='
-TEST_IMG="driver=qcow2,file.driver=file,file.filename=$TEST_IMG" _img_info --backing-chain --image-opts | _filter_img_info
+TEST_IMG="driver=$IMGFMT,file.driver=file,file.filename=$TEST_IMG" _img_info --backing-chain --image-opts \
+    | _filter_img_info | grep -v 'backing file format'
 
 # success, all done
 echo "*** done"
Signature · 1 line
2.23.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Max Reitz

First, driver=qcow2 will not work so well with non-qcow2 formats (and this test claims to support qcow, qed, and vmdk).

Second, vmdk will always report the backing file format to be vmdk. Filter that out so the output looks like for all other formats.

Third, the flat vmdk subformats do not support backing files, so they will not work with this test.

---
 tests/qemu-iotests/279 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tests/qemu-iotests/279 +2 -0
index 6682376808..30d29b1cb2 100755
@@ -38,6 +38,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto file
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" \
+                     "subformat=twoGbMaxExtentFlat" \
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
 TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base"
@@ -45,11 +47,12 @@ _make_test_img -b "$TEST_IMG.mid"
 

tests/qemu-iotests/279 _make_test_img -b "$TEST_IMG.mid" · line 55

Quoted 10 lines
tests/qemu-iotests/279 +3 -2
 echo
 echo '== qemu-img info --backing-chain =='
-_img_info --backing-chain | _filter_img_info
+_img_info --backing-chain | _filter_img_info | grep -v 'backing file format'
 
 echo
 echo '== qemu-img info --backing-chain --image-opts =='
-TEST_IMG="driver=qcow2,file.driver=file,file.filename=$TEST_IMG" _img_info --backing-chain --image-opts | _filter_img_info
+TEST_IMG="driver=$IMGFMT,file.driver=file,file.filename=$TEST_IMG" _img_info --backing-chain --image-opts \
+    | _filter_img_info | grep -v 'backing file format'

Haha.

Quoted 4 lines
tests/qemu-iotests/279 +0 -0
 # success, all done
 echo "*** done"
 
Tested-by on v1 1/1
#2 lore raw
In reply to Max Reitz
Quoted 33 lines · Max Reitz

First, driver=qcow2 will not work so well with non-qcow2 formats (and this test claims to support qcow, qed, and vmdk).

Second, vmdk will always report the backing file format to be vmdk. Filter that out so the output looks like for all other formats.

Third, the flat vmdk subformats do not support backing files, so they will not work with this test.

---
 tests/qemu-iotests/279 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tests/qemu-iotests/279 +2 -1
index 6682376808..30d29b1cb2 100755
@@ -38,6 +38,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow qcow2 vmdk qed
 _supported_proto file
 _supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" \
+                     "subformat=twoGbMaxExtentFlat" \
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 64M
 TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base"
@@ -45,11 +47,12 @@ _make_test_img -b "$TEST_IMG.mid"
 
 echo
 echo '== qemu-img info --backing-chain =='
-_img_info --backing-chain | _filter_img_info

tests/qemu-iotests/279 _make_test_img -b "$TEST_IMG.mid" · line 58

Quoted 10 lines
tests/qemu-iotests/279 +3 -1
+_img_info --backing-chain | _filter_img_info | grep -v 'backing file format'
 
 echo
 echo '== qemu-img info --backing-chain --image-opts =='
-TEST_IMG="driver=qcow2,file.driver=file,file.filename=$TEST_IMG" _img_info --backing-chain --image-opts | _filter_img_info
+TEST_IMG="driver=$IMGFMT,file.driver=file,file.filename=$TEST_IMG" _img_info --backing-chain --image-opts \
+    | _filter_img_info | grep -v 'backing file format'
 
 # success, all done
 echo "*** done"

This fixes the problems with "check -qed 279" and "check -vmdk 279" for me.

author Applied
#3 lore raw
In reply to Max Reitz
Quoted 6 lines · Max Reitz

First, driver=qcow2 will not work so well with non-qcow2 formats (and this test claims to support qcow, qed, and vmdk).

Second, vmdk will always report the backing file format to be vmdk. Filter that out so the output looks like for all other formats.

Quoted 7 lines

Third, the flat vmdk subformats do not support backing files, so they will not work with this test.

---
 tests/qemu-iotests/279 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Applied to my block branch.

Max