]> git.proxmox.com Git - mirror_qemu.git/commitdiff
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 b4f523460925900b8460d9d5b08e210793e764cf..813a84acac4782ed71179b314f4d65de8c0e813a 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 f41b92f35f52a2a745768123ad770ce472df2c16..20f8f185d0717021a56c06b1218fda1f013dec19 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 23298c6f59238479feb9a5f7d9a539bfc539188a..e2e766241e1ac9cfc0ef71cf5591adae5246b7ca 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 bba1ee59ae564faa5351949cf5487d5f54104668..e2556d8e577ec9a0b21c996ddd4cff280961447e 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 94c27131320bae03b504d6daa14eae5ff79df134..9254ede5e534c316cfe9594633380fa5e9278073 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 67cc7e74c2da71cd58ea0eb9107da1628fa90ae0..b102e49208b820dcbcf893f77c5f69c653229a73 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 bde408ca92ca05777e1a78520a570026d30c9f9e..a8feb7618460b854d9a7356c880da50f1c520a8d 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 272ecab195b07bb07f759302198dbc593f86080e..cdc53565410d14d52fc0094fde2134e31313f65a 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 e82bb6988140f5519dd4f9e7952a285c49967a64..71d299c4f927012b007260988daf3b1499f88641 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 8c3212a72f42f8538feb44bd5c1b0e36477f5497..ed01115fa3df249b80fef7cef6282e823b37c729 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 3941c3f0c23a835ec1ffeaea473e75b867f30eac..5438025285d51e758a03ac1eda2d1ed8a548f0e8 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 2818c6a4a3676cf26da743318c38b495251bd251..aad6b72d8a4f9e7ece3b0fcaaea13f7dd0c83a14 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 7cf0427af44b6728f4e324d1306e99fd30acae1e..eef2b8a53443eac22d47af317fc21496cc6bc361 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 3974714852d8be8c7342f672e54823d4b854f86e..b997b127f025dec7f616f87682b401a23fb0e8d9 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 bb4ad1cc089f8ae01172b247d783eb74c36f3022..62be89a0d9c8d03cac005bb8ba8b0b4f0c630075 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 4bcb5021e88099f5118c57877d2e056cfeb2007b..b1ecafb41e646bee4f467ea7d3d5d37075b29795 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 85acdf76d4386658d6c93e66bb719e6b985c137a..537d40dfd5ca8bd46d3f73e7f186fcc03977f1fd 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 d40fdab5421fa999dcbf481361819dfad7144257..bbea1252d20ee8e9c631438633500a53d9c15f51 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 b44edd0cf9139ecc85148f5805d31ce32b3ad2d3..ef1163346cf08ee3a20bf21afe23d98d7acbb5c6 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 e2e0726de169b1aaf0b23ca8f03c953b7345d513..40ec62b6f14f77e7c2f6838fec88cef8eee73052 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 d645952d54e23d5ff9147a17ac087164c5de7963..2d3e1004d344d630a2ea63c61f62cc28bf7649bc 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 58fe174b5ed10f5b0cf03d6b23d035be4419abd6..155ae86aa7805a064fdd5cba4b2019a0baa1b2f0 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 c3cf66798a9c98726c4ba7d1ccb386e257325c6e..b383c11e6ac7996af26d8c049cfcbd297ec6bebd 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 9897ceb6cd6a9275db2b5dfc7b1c026da4ea0f3b..ba638db11f9911dabd087f28e38f3e3c850e214a 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 2ef516baf18f4278b65090977fe0660e7812e8ec..f78df0e6e1e7e42e99eb244f8ca75a42cd5a8955 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 059011ebb1eccd2a68112e04f910e52792b1a049..dfa350936fe641ef22c61c0f840a858038fc3c26 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 74d40d0478d8dc5eef7202406f3228efd8a2d032..01b771c76ebc0e49eb70f3069ffb200df950ea3d 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 8c2ae79f2b9589e85cb9db6117d3879599e36640..5192d256e31462f051c3203325a27eb53e5b88cb 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 6b62271876ea5194d4a465be3ea07d9c2247a4da..daefcbaa5878f6696a92586ed34915d0770e6c26 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 011ed4f2bc10319bbec24774036099916d9807d8..4569ac0b4bfc36a1176c84facef33fa433fc71bc 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 e59090259cb6b1055503f8057a07ea19b0953316..2b1311176801e30485cf39ec65d829adf548d48a 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 2ffa3ca942ac3d38865f9533b1d63a410a5afb99..3f27db71f2bd2543cc1d47406f1cbf446fe8e20d 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 2557140ac26facf6cebd18c20c10507b8af52c65..f9690053a24a16824087dd2a9d528a3dde8db325 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 df89d3864b8815e3a7c856415bf6687b4d267de8..0572b5ae9abee580993e6c3329ba1fb975e8fa18 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 456a4bd8c4cb54c9c0d295f83bedab298da3daeb..f572a19af28c5d6529b449d2c771ddd0af2aa6ac 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 05dd6ed6c369f02650dbcb4ee3e844e3c25d5286..6c8f0e8085ba1c9ce0756ad6e200da5af1b6de89 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 d67997e5f62b25c206451bc44747a9018bb3d51e..7195fb895a0bd9802b6f73323d4b0c200fa4761b 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 29dcaa1960df8efde1d6ec6f11f4bf7966516146..ec6d1705e5867deb3a22d944523e842a89453a47 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 75b5e8f3141d99350ed15b0006988ca3631bdbb3..51a70fe669689d62d20d00c69f796415020980ad 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 1ccb850055146da800202b5e9fc170465f9f9f5e..56a2dd58e6fefa35b46e20275ddfd51e1ab52427 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 bced83fae0c5bb35bf460be3ed3c41aaf5c0a25c..3f74b9f62d9e93206b053a5b171bbceb2c794b42 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 454ff600cc38857336cd35ecd293ce954a296568..e50f19ebf00b7fab405666a1b0212de4b256a0ae 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 2fcef9e2bd216224ce1f134f4a6ab5be09ca8be1..c6e1dc57a01746cea1295c0ade032c4ca24f9b23 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 5890ff9cfccd9a5f6c34dab496703d9dd09cbabc..6d41650438e181bc9a708eac5d217b1fe53c54c3 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 21c16a32cb849c6901334142662310f7d9b4b5a2..23ab0ce899e0b75ed53aa75ff65803e25af991ad 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 ef7b9a94e29cbed2ef6cad94f04e370c923e24d7..48984b7ac1ed9ce020b98ff092d82f207a8c7e77 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 4d3d08ad6ffa48dc9378fb9008e3f5ce773a87d0..95f05b0e346084846fbbc5d3a9433e94dc6a72c0 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 d90488513629c061974e95f46c43961abae28099..a2cdd7f83d6626ded63595af54e11af5c418283c 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 55a1874dcd4a1d1403a47bbcd1e5252090ec3174..f99bae78c736a11dabe611062aaba3b2ef852bcf 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 fbd7404791838ff9377ebdb38473ab7b5f735522..c9a334c7e998949b9715d2f0e11a0dcefde4e638 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 e18a464fe06fc7b97c103b76555558f4907412f0..866168b236b482c8f249a36f604267d4b6d7509a 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 65b0e420632bddd01a6bcdc5c503e392319af278..685356ac3bae6da1bb80a3365373abf53f043872 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 2b84b896db1af0c8de1b9b729573525ac3e9c239..3dc3b6a711bf9db2c3f44554ecf4db6201842581 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 0375bc12d4f264631a0a3c163c279881550115ff..13263292b0a61f1e2d4c114558671f4d0ab74d88 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 c853b73819be3218f3b35d764c09429a7d9cade8..87e37b39e2d8ea72de39bc5fea197cf7d0e8d126 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 e4650ecf6b11f5f8f51fc52549e71fc86a5530af..2b99c9789ed2aa410c9b9431bd5f36ae8031f222 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 f6c8f71444181d8dab3df4ec72d5f5f48e158dcf..83280c1715dc29e453e74b0abc79f80cd5bef544 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