Patchwork [PATCHv2,14/18] qemu-iotests: fix test 043 to work with any protocol

login
register
mail settings
Submitter Peter Lieven
Date Jan. 5, 2014, 5:22 p.m.
Message ID <1388942528-10453-15-git-send-email-pl@kamp.de>
Download mbox | patch
Permalink /patch/306990/
State New
Headers show

Comments

Peter Lieven - Jan. 5, 2014, 5:22 p.m.
Signed-off-by: Peter Lieven <pl@kamp.de>
---
 tests/qemu-iotests/043     |   24 ++++++++++--------------
 tests/qemu-iotests/043.out |   12 ++++++------
 2 files changed, 16 insertions(+), 20 deletions(-)

Patch

diff --git a/tests/qemu-iotests/043 b/tests/qemu-iotests/043
index b316b97..4c9e930 100755
--- a/tests/qemu-iotests/043
+++ b/tests/qemu-iotests/043
@@ -31,7 +31,9 @@  status=1	# failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG".[123].base
+    if [ $IMGPROTO = "file" ]; then
+        rm -f "$TEST_IMG".[123].base
+    fi
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
@@ -41,7 +43,7 @@  trap "_cleanup; exit \$status" 0 1 2 3 15
 
 # Any format supporting backing files
 _supported_fmt qcow2 qed
-_supported_proto file
+_supported_proto generic
 _supported_os Linux
 
 
@@ -53,8 +55,7 @@  echo
 echo "== backing file references self =="
 _img_info --backing-chain
 
-_make_test_img $size
-mv "$TEST_IMG" "$TEST_IMG.base"
+TEST_IMG=$TEST_IMG.base _make_test_img $size
 _make_test_img -b "$TEST_IMG.base" $size
 $QEMU_IMG rebase -u -b "$TEST_IMG" "$TEST_IMG.base"
 
@@ -62,12 +63,9 @@  echo
 echo "== parent references self =="
 _img_info --backing-chain
 
-_make_test_img $size
-mv "$TEST_IMG" "$TEST_IMG.1.base"
-_make_test_img -b "$TEST_IMG.1.base" $size
-mv "$TEST_IMG" "$TEST_IMG.2.base"
-_make_test_img -b "$TEST_IMG.2.base" $size
-mv "$TEST_IMG" "$TEST_IMG.3.base"
+TEST_IMG=$TEST_IMG.1.base _make_test_img $size
+TEST_IMG=$TEST_IMG.2.base _make_test_img -b "$TEST_IMG.1.base" $size
+TEST_IMG=$TEST_IMG.3.base _make_test_img -b "$TEST_IMG.2.base" $size
 _make_test_img -b "$TEST_IMG.3.base" $size
 $QEMU_IMG rebase -u -b "$TEST_IMG.2.base" "$TEST_IMG.1.base"
 
@@ -75,10 +73,8 @@  echo
 echo "== ancestor references another ancestor =="
 _img_info --backing-chain
 
-_make_test_img $size
-mv "$TEST_IMG" "$TEST_IMG.1.base"
-_make_test_img -b "$TEST_IMG.1.base" $size
-mv "$TEST_IMG" "$TEST_IMG.2.base"
+TEST_IMG=$TEST_IMG.1.base _make_test_img $size
+TEST_IMG=$TEST_IMG.2.base _make_test_img -b "$TEST_IMG.1.base" $size
 _make_test_img -b "$TEST_IMG.2.base" $size
 
 echo
diff --git a/tests/qemu-iotests/043.out b/tests/qemu-iotests/043.out
index ad23337..3a7cef8 100644
--- a/tests/qemu-iotests/043.out
+++ b/tests/qemu-iotests/043.out
@@ -3,20 +3,20 @@  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
 
 == backing file references self ==
 qemu-img: Backing file 'TEST_DIR/t.IMGFMT' creates an infinite loop.
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=134217728 
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.base' 
 
 == parent references self ==
 qemu-img: Backing file 'TEST_DIR/t.IMGFMT' creates an infinite loop.
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.1.base' 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.2.base' 
+Formatting 'TEST_DIR/t.IMGFMT.1.base', fmt=IMGFMT size=134217728 
+Formatting 'TEST_DIR/t.IMGFMT.2.base', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.1.base' 
+Formatting 'TEST_DIR/t.IMGFMT.3.base', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.2.base' 
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.3.base' 
 
 == ancestor references another ancestor ==
 qemu-img: Backing file 'TEST_DIR/t.IMGFMT.2.base' creates an infinite loop.
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.1.base' 
+Formatting 'TEST_DIR/t.IMGFMT.1.base', fmt=IMGFMT size=134217728 
+Formatting 'TEST_DIR/t.IMGFMT.2.base', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.1.base' 
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.2.base' 
 
 == finite chain of length 3 (human) ==