OSDN Git Service

iotests: Use _rm_test_img for deleting test images
authorMax Reitz <mreitz@redhat.com>
Thu, 7 Nov 2019 16:37:01 +0000 (17:37 +0100)
committerMax Reitz <mreitz@redhat.com>
Mon, 6 Jan 2020 12:43:07 +0000 (13:43 +0100)
Just rm will not delete external data files.  Use _rm_test_img every
time we delete a test image.

(In the process, clean up the indentation of every _cleanup() this patch
touches.)

((Also, use quotes consistently.  I am happy to see unquoted instances
like "rm -rf $TEST_DIR/..." go.))

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-id: 20191107163708.833192-16-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
57 files changed:
tests/qemu-iotests/019
tests/qemu-iotests/020
tests/qemu-iotests/024
tests/qemu-iotests/028
tests/qemu-iotests/029
tests/qemu-iotests/043
tests/qemu-iotests/048
tests/qemu-iotests/050
tests/qemu-iotests/053
tests/qemu-iotests/058
tests/qemu-iotests/059
tests/qemu-iotests/061
tests/qemu-iotests/063
tests/qemu-iotests/069
tests/qemu-iotests/074
tests/qemu-iotests/080
tests/qemu-iotests/081
tests/qemu-iotests/085
tests/qemu-iotests/088
tests/qemu-iotests/092
tests/qemu-iotests/094
tests/qemu-iotests/095
tests/qemu-iotests/099
tests/qemu-iotests/109
tests/qemu-iotests/110
tests/qemu-iotests/122
tests/qemu-iotests/123
tests/qemu-iotests/141
tests/qemu-iotests/142
tests/qemu-iotests/144
tests/qemu-iotests/153
tests/qemu-iotests/156
tests/qemu-iotests/159
tests/qemu-iotests/160
tests/qemu-iotests/161
tests/qemu-iotests/170
tests/qemu-iotests/172
tests/qemu-iotests/173
tests/qemu-iotests/178
tests/qemu-iotests/182
tests/qemu-iotests/183
tests/qemu-iotests/185
tests/qemu-iotests/187
tests/qemu-iotests/190
tests/qemu-iotests/191
tests/qemu-iotests/195
tests/qemu-iotests/197
tests/qemu-iotests/200
tests/qemu-iotests/215
tests/qemu-iotests/225
tests/qemu-iotests/229
tests/qemu-iotests/232
tests/qemu-iotests/243
tests/qemu-iotests/244
tests/qemu-iotests/247
tests/qemu-iotests/249
tests/qemu-iotests/252

index b4f5234..813a84a 100755 (executable)
@@ -30,9 +30,9 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-       _cleanup_test_img
-    rm -f "$TEST_IMG.base"
-    rm -f "$TEST_IMG.orig"
+    _cleanup_test_img
+    _rm_test_img "$TEST_IMG.base"
+    _rm_test_img "$TEST_IMG.orig"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index f41b92f..20f8f18 100755 (executable)
@@ -28,9 +28,9 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-       _cleanup_test_img
-    rm -f "$TEST_IMG.base"
-    rm -f "$TEST_IMG.orig"
+    _cleanup_test_img
+    _rm_test_img "$TEST_IMG.base"
+    _rm_test_img "$TEST_IMG.orig"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 23298c6..e2e7662 100755 (executable)
@@ -29,12 +29,12 @@ status=1    # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_DIR/t.$IMGFMT.base_old"
-    rm -f "$TEST_DIR/t.$IMGFMT.base_new"
+    _rm_test_img "$TEST_DIR/t.$IMGFMT.base_old"
+    _rm_test_img "$TEST_DIR/t.$IMGFMT.base_new"
 
-    rm -f "$TEST_DIR/subdir/t.$IMGFMT"
-    rm -f "$TEST_DIR/subdir/t.$IMGFMT.base_old"
-    rm -f "$TEST_DIR/subdir/t.$IMGFMT.base_new"
+    _rm_test_img "$TEST_DIR/subdir/t.$IMGFMT"
+    _rm_test_img "$TEST_DIR/subdir/t.$IMGFMT.base_old"
+    _rm_test_img "$TEST_DIR/subdir/t.$IMGFMT.base_new"
     rmdir "$TEST_DIR/subdir" 2> /dev/null
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index bba1ee5..e2556d8 100755 (executable)
@@ -32,7 +32,7 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_qemu
-    rm -f "${TEST_IMG}.copy"
+    _rm_test_img "${TEST_IMG}.copy"
     _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index 94c2713..9254ede 100755 (executable)
@@ -28,7 +28,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-    rm -f $TEST_IMG.snap
+    _rm_test_img "$TEST_IMG.snap"
     _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index 67cc7e7..b102e49 100755 (executable)
@@ -29,7 +29,9 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG".[123].base
+    for img in "$TEST_IMG".[123].base; do
+        _rm_test_img "$img"
+    done
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index bde408c..a8feb76 100755 (executable)
@@ -31,7 +31,7 @@ _cleanup()
 {
     echo "Cleanup"
     _cleanup_test_img
-    rm "${TEST_IMG_FILE2}"
+    _rm_test_img "${TEST_IMG_FILE2}"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 272ecab..cdc5356 100755 (executable)
@@ -29,8 +29,8 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.old"
-    rm -f "$TEST_IMG.new"
+    _rm_test_img "$TEST_IMG.old"
+    _rm_test_img "$TEST_IMG.new"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index e82bb69..71d299c 100755 (executable)
@@ -28,8 +28,8 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-       rm -f "$TEST_IMG.orig"
-       _cleanup_test_img
+    _rm_test_img "$TEST_IMG.orig"
+    _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 8c3212a..ed01115 100755 (executable)
@@ -42,7 +42,7 @@ _cleanup()
 {
     nbd_server_stop
     _cleanup_test_img
-    rm -f "$converted_image"
+    _rm_test_img "$converted_image"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 3941c3f..5438025 100755 (executable)
@@ -29,7 +29,7 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.qcow2"
+    IMGFMT=qcow2 _rm_test_img "$TEST_IMG.qcow2"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 2818c6a..aad6b72 100755 (executable)
@@ -29,7 +29,7 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f $TEST_IMG.data
+    _rm_test_img "$TEST_IMG.data"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 7cf0427..eef2b8a 100755 (executable)
@@ -29,8 +29,10 @@ status=1     # failure is the default!
 
 _cleanup()
 {
-       _cleanup_test_img
-       rm -f "$TEST_IMG.orig" "$TEST_IMG.raw1" "$TEST_IMG.raw2"
+    _cleanup_test_img
+    for img in "$TEST_IMG".{orig,raw1,raw2,target}; do
+        _rm_test_img "$img"
+    done
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 3974714..b997b12 100755 (executable)
@@ -47,7 +47,7 @@ echo "=== Creating an image with a backing file and deleting that file ==="
 echo
 TEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE
 _make_test_img -b "$TEST_IMG.base" $IMG_SIZE
-rm -f "$TEST_IMG.base"
+_rm_test_img "$TEST_IMG.base"
 # Just open the image and close it right again (this should print an error message)
 $QEMU_IO -c quit "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
 
index bb4ad1c..62be89a 100755 (executable)
@@ -31,7 +31,7 @@ _cleanup()
 {
     echo "Cleanup"
     _cleanup_test_img
-    rm "${TEST_IMG2}"
+    _rm_test_img "${TEST_IMG2}"
     rm -f "$TEST_DIR/blkdebug.conf"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index 4bcb502..b1ecafb 100755 (executable)
@@ -28,7 +28,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-    rm -f $TEST_IMG.snap
+    _rm_test_img "$TEST_IMG.snap"
     _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index 85acdf7..537d40d 100755 (executable)
@@ -28,9 +28,9 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-    rm -rf $TEST_DIR/1.raw
-    rm -rf $TEST_DIR/2.raw
-    rm -rf $TEST_DIR/3.raw
+    _rm_test_img "$TEST_DIR/1.raw"
+    _rm_test_img "$TEST_DIR/2.raw"
+    _rm_test_img "$TEST_DIR/3.raw"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index d40fdab..bbea125 100755 (executable)
@@ -41,10 +41,13 @@ _cleanup()
     _cleanup_qemu
     for i in $(seq 1 ${SNAPSHOTS})
     do
-        rm -f "${TEST_DIR}/${i}-${snapshot_virt0}"
-        rm -f "${TEST_DIR}/${i}-${snapshot_virt1}"
+        _rm_test_img "${TEST_DIR}/${i}-${snapshot_virt0}"
+        _rm_test_img "${TEST_DIR}/${i}-${snapshot_virt1}"
+    done
+    for img in "${TEST_IMG}".{1,2,base}
+    do
+        _rm_test_img "$img"
     done
-    rm -f "${TEST_IMG}" "${TEST_IMG}.1" "${TEST_IMG}.2" "${TEST_IMG}.base"
 
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index b44edd0..ef11633 100755 (executable)
@@ -28,7 +28,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-    rm -f $TEST_IMG.snap
+    _rm_test_img "$TEST_IMG.snap"
     _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index e2e0726..40ec62b 100755 (executable)
@@ -28,7 +28,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-    rm -f $TEST_IMG.snap
+    _rm_test_img "$TEST_IMG.snap"
     _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index d645952..2d3e100 100755 (executable)
@@ -30,7 +30,7 @@ _cleanup()
 {
     _cleanup_qemu
     _cleanup_test_img
-    rm -f "$TEST_DIR/source.$IMGFMT"
+    _rm_test_img "$TEST_DIR/source.$IMGFMT"
 }
 
 trap "_cleanup; exit \$status" 0 1 2 3 15
index 58fe174..155ae86 100755 (executable)
@@ -32,8 +32,9 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_qemu
-    rm  -f "${TEST_IMG}.base" "${TEST_IMG}.snp1"
-       _cleanup_test_img
+    _rm_test_img "${TEST_IMG}.base"
+    _rm_test_img "${TEST_IMG}.snp1"
+    _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index c3cf667..b383c11 100755 (executable)
@@ -29,7 +29,10 @@ status=1     # failure is the default!
 
 _cleanup()
 {
-       _cleanup_test_img
+    _cleanup_test_img
+    _rm_test_img "$TEST_IMG.compare"
+    rm -f "$TEST_DIR/blkdebug.conf"
+
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
@@ -121,8 +124,6 @@ echo
 test_qemu "file.driver=blkdebug,file.image.filename=$TEST_IMG"
 
 
-rm -f "$TEST_IMG.compare" "$TEST_DIR/blkdebug.conf"
-
 # success, all done
 echo "*** done"
 rm -f $seq.full
index 9897ceb..ba638db 100755 (executable)
@@ -29,8 +29,8 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_qemu
-    rm -f $TEST_IMG.src
-       _cleanup_test_img
+    _rm_test_img "$TEST_IMG.src"
+    _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 2ef516b..f78df0e 100755 (executable)
@@ -28,8 +28,8 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-       _cleanup_test_img
-        rm -f "$TEST_IMG.copy"
+    _cleanup_test_img
+    _rm_test_img "$TEST_IMG.copy"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 059011e..dfa3509 100755 (executable)
@@ -28,8 +28,10 @@ status=1     # failure is the default!
 
 _cleanup()
 {
-    rm -f "$TEST_IMG".[123]
-       _cleanup_test_img
+    for img in "$TEST_IMG".[123]; do
+        _rm_test_img "$img"
+    done
+    _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 74d40d0..01b771c 100755 (executable)
@@ -29,7 +29,7 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$SRC_IMG"
+    _rm_test_img "$SRC_IMG"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 8c2ae79..5192d25 100755 (executable)
@@ -30,7 +30,9 @@ _cleanup()
 {
     _cleanup_qemu
     _cleanup_test_img
-    rm -f "$TEST_DIR"/{b,m,o}.$IMGFMT
+    for img in "$TEST_DIR"/{b,m,o}.$IMGFMT; do
+        _rm_test_img "$img"
+    done
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 6b62271..daefcba 100755 (executable)
@@ -29,7 +29,7 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f $TEST_IMG.snap
+    _rm_test_img "$TEST_IMG.snap"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 011ed4f..4569ac0 100755 (executable)
@@ -34,7 +34,9 @@ TMP_SNAP2=${TEST_DIR}/tmp2.qcow2
 _cleanup()
 {
     _cleanup_qemu
-    rm -f "${TEST_IMG}" "${TMP_SNAP1}" "${TMP_SNAP2}"
+    for img in "${TEST_IMG}" "${TMP_SNAP1}" "${TMP_SNAP2}"; do
+        _rm_test_img "$img"
+    done
 }
 
 trap "_cleanup; exit \$status" 0 1 2 3 15
index e590902..2b13111 100755 (executable)
@@ -30,13 +30,9 @@ status=1     # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "${TEST_IMG}.base"
-    rm -f "${TEST_IMG}.overlay"
-    rm -f "${TEST_IMG}.convert"
-    rm -f "${TEST_IMG}.a"
-    rm -f "${TEST_IMG}.b"
-    rm -f "${TEST_IMG}.c"
-    rm -f "${TEST_IMG}.lnk"
+    for img in "${TEST_IMG}".{base,overlay,convert,a,b,c,lnk}; do
+        _rm_test_img "$img"
+    done
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 2ffa3ca..3f27db7 100755 (executable)
@@ -37,7 +37,9 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_qemu
-    rm -f "$TEST_IMG"{,.target}{,.backing,.overlay}
+    for img in "$TEST_IMG"{,.target}{,.backing,.overlay}; do
+        _rm_test_img "$img"
+    done
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
@@ -120,7 +122,9 @@ _send_qemu_cmd $QEMU_HANDLE \
     '"status": "null"'
 
 # Remove the source images
-rm -f "$TEST_IMG{,.backing,.overlay}"
+for img in "$TEST_IMG{,.backing,.overlay}"; do
+    _rm_test_img "$img"
+done
 
 echo
 
index 2557140..f969005 100755 (executable)
@@ -28,7 +28,7 @@ status=1
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.out"
+    _rm_test_img "$TEST_IMG.out"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index df89d38..0572b5a 100755 (executable)
@@ -28,7 +28,8 @@ status=1
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.out" "$TEST_IMG.out.dd"
+    _rm_test_img "$TEST_IMG.out"
+    _rm_test_img "$TEST_IMG.out.dd"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 456a4bd..f572a19 100755 (executable)
@@ -30,8 +30,8 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.base"
-    rm -f "$TEST_IMG.int"
+    _rm_test_img "$TEST_IMG.base"
+    _rm_test_img "$TEST_IMG.int"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 05dd6ed..6c8f0e8 100755 (executable)
@@ -28,7 +28,7 @@ status=1
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.out"
+    _rm_test_img  "$TEST_IMG.out"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index d67997e..7195fb8 100755 (executable)
@@ -28,9 +28,9 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-       _cleanup_test_img
-    rm -f "$TEST_IMG.2"
-    rm -f "$TEST_IMG.3"
+    _cleanup_test_img
+    _rm_test_img "$TEST_IMG.2"
+    _rm_test_img "$TEST_IMG.3"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 29dcaa1..ec6d170 100755 (executable)
@@ -29,7 +29,8 @@ status=1    # failure is the default!
 _cleanup()
 {
     _cleanup_qemu
-    rm  -f "${QEMU_TEST_DIR}/image.base" "${QEMU_TEST_DIR}/image.snp1"
+    _rm_test_img "${TEST_DIR}/image.base"
+    _rm_test_img "${TEST_DIR}/image.snp1"
     _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index 75b5e8f..51a70fe 100755 (executable)
@@ -29,7 +29,7 @@ status=1    # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.converted"
+    _rm_test_img "$TEST_IMG.converted"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 1ccb850..56a2dd5 100755 (executable)
@@ -30,7 +30,7 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.overlay"
+    _rm_test_img "$TEST_IMG.overlay"
     rm -f "$SOCK_DIR/nbd.socket"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index bced83f..3f74b9f 100755 (executable)
@@ -31,7 +31,7 @@ MIG_SOCKET="${SOCK_DIR}/migrate"
 _cleanup()
 {
     rm -f "${MIG_SOCKET}"
-    rm -f "${TEST_IMG}.dest"
+    _rm_test_img "${TEST_IMG}.dest"
     _cleanup_test_img
     _cleanup_qemu
 }
index 454ff60..e50f19e 100755 (executable)
@@ -28,8 +28,8 @@ status=1 # failure is the default!
 
 _cleanup()
 {
-    rm -f "${TEST_IMG}.mid"
-    rm -f "${TEST_IMG}.copy"
+    _rm_test_img "${TEST_IMG}.mid"
+    _rm_test_img "${TEST_IMG}.copy"
     _cleanup_test_img
     _cleanup_qemu
 }
index 2fcef9e..c6e1dc5 100755 (executable)
@@ -28,9 +28,9 @@ status=1      # failure is the default!
 
 _cleanup()
 {
-       _cleanup_test_img
-    rm -f "$TEST_IMG.2"
-    rm -f "$TEST_IMG.3"
+    _cleanup_test_img
+    _rm_test_img "$TEST_IMG.2"
+    _rm_test_img "$TEST_IMG.3"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 5890ff9..6d41650 100755 (executable)
@@ -29,7 +29,7 @@ status=1    # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.converted"
+    _rm_test_img "$TEST_IMG.converted"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 21c16a3..23ab0ce 100755 (executable)
@@ -28,9 +28,9 @@ status=1 # failure is the default!
 
 _cleanup()
 {
-    rm -f "${TEST_IMG}.mid"
-    rm -f "${TEST_IMG}.ovl2"
-    rm -f "${TEST_IMG}.ovl3"
+    _rm_test_img "${TEST_IMG}.mid"
+    _rm_test_img "${TEST_IMG}.ovl2"
+    _rm_test_img "${TEST_IMG}.ovl3"
     _cleanup_test_img
     _cleanup_qemu
 }
index ef7b9a9..48984b7 100755 (executable)
@@ -29,7 +29,7 @@ status=1 # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.mid"
+    _rm_test_img "$TEST_IMG.mid"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 4d3d08a..95f05b0 100755 (executable)
@@ -43,7 +43,7 @@ esac
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_WRAP"
+    _rm_test_img "$TEST_WRAP"
     rm -f "$BLKDBG_CONF"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index d904885..a2cdd7f 100755 (executable)
@@ -31,7 +31,8 @@ status=1    # failure is the default!
 _cleanup()
 {
     _cleanup_qemu
-    rm -f "${TEST_IMG}" "${BACKING_IMG}"
+    _rm_test_img "${TEST_IMG}"
+    _rm_test_img "${BACKING_IMG}"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 55a1874..f99bae7 100755 (executable)
@@ -40,7 +40,7 @@ esac
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_WRAP"
+    _rm_test_img "$TEST_WRAP"
     rm -f "$BLKDBG_CONF"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index fbd7404..c9a334c 100755 (executable)
@@ -29,7 +29,7 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.not_base"
+    _rm_test_img "$TEST_IMG.not_base"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index e18a464..866168b 100755 (executable)
@@ -31,7 +31,8 @@ _cleanup()
 {
     _cleanup_qemu
     _cleanup_test_img
-    rm -f "$TEST_IMG" "$DEST_IMG"
+    _rm_test_img "$TEST_IMG"
+    _rm_test_img "$DEST_IMG"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 65b0e42..685356a 100755 (executable)
@@ -29,7 +29,9 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f $TEST_IMG.[01234]
+    for img in "$TEST_IMG".[01234]; do
+        _rm_test_img "$img"
+    done
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 2b84b89..3dc3b6a 100755 (executable)
@@ -29,7 +29,7 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f $TEST_IMG.data
+    _rm_test_img "$TEST_IMG.data"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 0375bc1..1326329 100755 (executable)
@@ -29,8 +29,8 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f $TEST_IMG.data
-    rm -f $TEST_IMG.src
+    _rm_test_img "$TEST_IMG.data"
+    _rm_test_img "$TEST_IMG.src"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index c853b73..87e37b3 100755 (executable)
@@ -29,7 +29,9 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f $TEST_IMG.[01234]
+    for img in "$TEST_IMG".[01234]; do
+        _rm_test_img "$img"
+    done
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index e4650ec..2b99c97 100755 (executable)
@@ -30,8 +30,8 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.base"
-    rm -f "$TEST_IMG.int"
+    _rm_test_img "$TEST_IMG.base"
+    _rm_test_img "$TEST_IMG.int"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index f6c8f71..83280c1 100755 (executable)
@@ -29,7 +29,7 @@ status=1      # failure is the default!
 _cleanup()
 {
     _cleanup_test_img
-    rm -f "$TEST_IMG.base_new"
+    _rm_test_img "$TEST_IMG.base_new"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15