aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-11-07 17:37:01 +0100
committerMax Reitz <mreitz@redhat.com>2020-01-06 13:43:07 +0100
commitf91ecbd74eb75e9d4c7b4016edaf69d070cb3f9b (patch)
tree67c2a289d1ed38e9c8b94dbaee48496081f1d4af /tests
parent52a97b5a42d485e89ce61c0310c3cd78fb998938 (diff)
downloadqemu-f91ecbd74eb75e9d4c7b4016edaf69d070cb3f9b.zip
qemu-f91ecbd74eb75e9d4c7b4016edaf69d070cb3f9b.tar.gz
qemu-f91ecbd74eb75e9d4c7b4016edaf69d070cb3f9b.tar.bz2
iotests: Use _rm_test_img for deleting test images
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>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qemu-iotests/0196
-rwxr-xr-xtests/qemu-iotests/0206
-rwxr-xr-xtests/qemu-iotests/02410
-rwxr-xr-xtests/qemu-iotests/0282
-rwxr-xr-xtests/qemu-iotests/0292
-rwxr-xr-xtests/qemu-iotests/0434
-rwxr-xr-xtests/qemu-iotests/0482
-rwxr-xr-xtests/qemu-iotests/0504
-rwxr-xr-xtests/qemu-iotests/0534
-rwxr-xr-xtests/qemu-iotests/0582
-rwxr-xr-xtests/qemu-iotests/0592
-rwxr-xr-xtests/qemu-iotests/0612
-rwxr-xr-xtests/qemu-iotests/0636
-rwxr-xr-xtests/qemu-iotests/0692
-rwxr-xr-xtests/qemu-iotests/0742
-rwxr-xr-xtests/qemu-iotests/0802
-rwxr-xr-xtests/qemu-iotests/0816
-rwxr-xr-xtests/qemu-iotests/0859
-rwxr-xr-xtests/qemu-iotests/0882
-rwxr-xr-xtests/qemu-iotests/0922
-rwxr-xr-xtests/qemu-iotests/0942
-rwxr-xr-xtests/qemu-iotests/0955
-rwxr-xr-xtests/qemu-iotests/0997
-rwxr-xr-xtests/qemu-iotests/1094
-rwxr-xr-xtests/qemu-iotests/1104
-rwxr-xr-xtests/qemu-iotests/1226
-rwxr-xr-xtests/qemu-iotests/1232
-rwxr-xr-xtests/qemu-iotests/1414
-rwxr-xr-xtests/qemu-iotests/1422
-rwxr-xr-xtests/qemu-iotests/1444
-rwxr-xr-xtests/qemu-iotests/15310
-rwxr-xr-xtests/qemu-iotests/1568
-rwxr-xr-xtests/qemu-iotests/1592
-rwxr-xr-xtests/qemu-iotests/1603
-rwxr-xr-xtests/qemu-iotests/1614
-rwxr-xr-xtests/qemu-iotests/1702
-rwxr-xr-xtests/qemu-iotests/1726
-rwxr-xr-xtests/qemu-iotests/1733
-rwxr-xr-xtests/qemu-iotests/1782
-rwxr-xr-xtests/qemu-iotests/1822
-rwxr-xr-xtests/qemu-iotests/1832
-rwxr-xr-xtests/qemu-iotests/1854
-rwxr-xr-xtests/qemu-iotests/1876
-rwxr-xr-xtests/qemu-iotests/1902
-rwxr-xr-xtests/qemu-iotests/1916
-rwxr-xr-xtests/qemu-iotests/1952
-rwxr-xr-xtests/qemu-iotests/1972
-rwxr-xr-xtests/qemu-iotests/2003
-rwxr-xr-xtests/qemu-iotests/2152
-rwxr-xr-xtests/qemu-iotests/2252
-rwxr-xr-xtests/qemu-iotests/2293
-rwxr-xr-xtests/qemu-iotests/2324
-rwxr-xr-xtests/qemu-iotests/2432
-rwxr-xr-xtests/qemu-iotests/2444
-rwxr-xr-xtests/qemu-iotests/2474
-rwxr-xr-xtests/qemu-iotests/2494
-rwxr-xr-xtests/qemu-iotests/2522
57 files changed, 118 insertions, 95 deletions
diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019
index b4f5234..813a84a 100755
--- a/tests/qemu-iotests/019
+++ b/tests/qemu-iotests/019
@@ -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
diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
index f41b92f..20f8f18 100755
--- a/tests/qemu-iotests/020
+++ b/tests/qemu-iotests/020
@@ -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
diff --git a/tests/qemu-iotests/024 b/tests/qemu-iotests/024
index 23298c6..e2e7662 100755
--- a/tests/qemu-iotests/024
+++ b/tests/qemu-iotests/024
@@ -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
diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index bba1ee5..e2556d8 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -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
diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029
index 94c2713..9254ede 100755
--- a/tests/qemu-iotests/029
+++ b/tests/qemu-iotests/029
@@ -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
diff --git a/tests/qemu-iotests/043 b/tests/qemu-iotests/043
index 67cc7e7..b102e49 100755
--- a/tests/qemu-iotests/043
+++ b/tests/qemu-iotests/043
@@ -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
diff --git a/tests/qemu-iotests/048 b/tests/qemu-iotests/048
index bde408c..a8feb76 100755
--- a/tests/qemu-iotests/048
+++ b/tests/qemu-iotests/048
@@ -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
diff --git a/tests/qemu-iotests/050 b/tests/qemu-iotests/050
index 272ecab..cdc5356 100755
--- a/tests/qemu-iotests/050
+++ b/tests/qemu-iotests/050
@@ -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
diff --git a/tests/qemu-iotests/053 b/tests/qemu-iotests/053
index e82bb69..71d299c 100755
--- a/tests/qemu-iotests/053
+++ b/tests/qemu-iotests/053
@@ -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
diff --git a/tests/qemu-iotests/058 b/tests/qemu-iotests/058
index 8c3212a..ed01115 100755
--- a/tests/qemu-iotests/058
+++ b/tests/qemu-iotests/058
@@ -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
diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index 3941c3f..5438025 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -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
diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
index 2818c6a..aad6b72 100755
--- a/tests/qemu-iotests/061
+++ b/tests/qemu-iotests/061
@@ -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
diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063
index 7cf0427..eef2b8a 100755
--- a/tests/qemu-iotests/063
+++ b/tests/qemu-iotests/063
@@ -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
diff --git a/tests/qemu-iotests/069 b/tests/qemu-iotests/069
index 3974714..b997b12 100755
--- a/tests/qemu-iotests/069
+++ b/tests/qemu-iotests/069
@@ -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
diff --git a/tests/qemu-iotests/074 b/tests/qemu-iotests/074
index bb4ad1c..62be89a 100755
--- a/tests/qemu-iotests/074
+++ b/tests/qemu-iotests/074
@@ -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
diff --git a/tests/qemu-iotests/080 b/tests/qemu-iotests/080
index 4bcb502..b1ecafb 100755
--- a/tests/qemu-iotests/080
+++ b/tests/qemu-iotests/080
@@ -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
diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081
index 85acdf7..537d40d 100755
--- a/tests/qemu-iotests/081
+++ b/tests/qemu-iotests/081
@@ -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
diff --git a/tests/qemu-iotests/085 b/tests/qemu-iotests/085
index d40fdab..bbea125 100755
--- a/tests/qemu-iotests/085
+++ b/tests/qemu-iotests/085
@@ -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
diff --git a/tests/qemu-iotests/088 b/tests/qemu-iotests/088
index b44edd0..ef11633 100755
--- a/tests/qemu-iotests/088
+++ b/tests/qemu-iotests/088
@@ -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
diff --git a/tests/qemu-iotests/092 b/tests/qemu-iotests/092
index e2e0726..40ec62b 100755
--- a/tests/qemu-iotests/092
+++ b/tests/qemu-iotests/092
@@ -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
diff --git a/tests/qemu-iotests/094 b/tests/qemu-iotests/094
index d645952..2d3e100 100755
--- a/tests/qemu-iotests/094
+++ b/tests/qemu-iotests/094
@@ -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
diff --git a/tests/qemu-iotests/095 b/tests/qemu-iotests/095
index 58fe174..155ae86 100755
--- a/tests/qemu-iotests/095
+++ b/tests/qemu-iotests/095
@@ -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
diff --git a/tests/qemu-iotests/099 b/tests/qemu-iotests/099
index c3cf667..b383c11 100755
--- a/tests/qemu-iotests/099
+++ b/tests/qemu-iotests/099
@@ -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
diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109
index 9897ceb..ba638db 100755
--- a/tests/qemu-iotests/109
+++ b/tests/qemu-iotests/109
@@ -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
diff --git a/tests/qemu-iotests/110 b/tests/qemu-iotests/110
index 2ef516b..f78df0e 100755
--- a/tests/qemu-iotests/110
+++ b/tests/qemu-iotests/110
@@ -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
diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
index 059011e..dfa3509 100755
--- a/tests/qemu-iotests/122
+++ b/tests/qemu-iotests/122
@@ -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
diff --git a/tests/qemu-iotests/123 b/tests/qemu-iotests/123
index 74d40d0..01b771c 100755
--- a/tests/qemu-iotests/123
+++ b/tests/qemu-iotests/123
@@ -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
diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141
index 8c2ae79..5192d25 100755
--- a/tests/qemu-iotests/141
+++ b/tests/qemu-iotests/141
@@ -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
diff --git a/tests/qemu-iotests/142 b/tests/qemu-iotests/142
index 6b62271..daefcba 100755
--- a/tests/qemu-iotests/142
+++ b/tests/qemu-iotests/142
@@ -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
diff --git a/tests/qemu-iotests/144 b/tests/qemu-iotests/144
index 011ed4f..4569ac0 100755
--- a/tests/qemu-iotests/144
+++ b/tests/qemu-iotests/144
@@ -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
diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153
index e590902..2b13111 100755
--- a/tests/qemu-iotests/153
+++ b/tests/qemu-iotests/153
@@ -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
diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156
index 2ffa3ca..3f27db7 100755
--- a/tests/qemu-iotests/156
+++ b/tests/qemu-iotests/156
@@ -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
diff --git a/tests/qemu-iotests/159 b/tests/qemu-iotests/159
index 2557140..f969005 100755
--- a/tests/qemu-iotests/159
+++ b/tests/qemu-iotests/159
@@ -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
diff --git a/tests/qemu-iotests/160 b/tests/qemu-iotests/160
index df89d38..0572b5a 100755
--- a/tests/qemu-iotests/160
+++ b/tests/qemu-iotests/160
@@ -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
diff --git a/tests/qemu-iotests/161 b/tests/qemu-iotests/161
index 456a4bd..f572a19 100755
--- a/tests/qemu-iotests/161
+++ b/tests/qemu-iotests/161
@@ -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
diff --git a/tests/qemu-iotests/170 b/tests/qemu-iotests/170
index 05dd6ed..6c8f0e8 100755
--- a/tests/qemu-iotests/170
+++ b/tests/qemu-iotests/170
@@ -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
diff --git a/tests/qemu-iotests/172 b/tests/qemu-iotests/172
index d67997e..7195fb8 100755
--- a/tests/qemu-iotests/172
+++ b/tests/qemu-iotests/172
@@ -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
diff --git a/tests/qemu-iotests/173 b/tests/qemu-iotests/173
index 29dcaa1..ec6d170 100755
--- a/tests/qemu-iotests/173
+++ b/tests/qemu-iotests/173
@@ -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
diff --git a/tests/qemu-iotests/178 b/tests/qemu-iotests/178
index 75b5e8f..51a70fe 100755
--- a/tests/qemu-iotests/178
+++ b/tests/qemu-iotests/178
@@ -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
diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182
index 1ccb850..56a2dd5 100755
--- a/tests/qemu-iotests/182
+++ b/tests/qemu-iotests/182
@@ -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
diff --git a/tests/qemu-iotests/183 b/tests/qemu-iotests/183
index bced83f..3f74b9f 100755
--- a/tests/qemu-iotests/183
+++ b/tests/qemu-iotests/183
@@ -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
}
diff --git a/tests/qemu-iotests/185 b/tests/qemu-iotests/185
index 454ff60..e50f19e 100755
--- a/tests/qemu-iotests/185
+++ b/tests/qemu-iotests/185
@@ -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
}
diff --git a/tests/qemu-iotests/187 b/tests/qemu-iotests/187
index 2fcef9e..c6e1dc5 100755
--- a/tests/qemu-iotests/187
+++ b/tests/qemu-iotests/187
@@ -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
diff --git a/tests/qemu-iotests/190 b/tests/qemu-iotests/190
index 5890ff9..6d416504 100755
--- a/tests/qemu-iotests/190
+++ b/tests/qemu-iotests/190
@@ -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
diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191
index 21c16a3..23ab0ce 100755
--- a/tests/qemu-iotests/191
+++ b/tests/qemu-iotests/191
@@ -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
}
diff --git a/tests/qemu-iotests/195 b/tests/qemu-iotests/195
index ef7b9a9..48984b7 100755
--- a/tests/qemu-iotests/195
+++ b/tests/qemu-iotests/195
@@ -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
diff --git a/tests/qemu-iotests/197 b/tests/qemu-iotests/197
index 4d3d08a..95f05b0 100755
--- a/tests/qemu-iotests/197
+++ b/tests/qemu-iotests/197
@@ -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
diff --git a/tests/qemu-iotests/200 b/tests/qemu-iotests/200
index d904885..a2cdd7f 100755
--- a/tests/qemu-iotests/200
+++ b/tests/qemu-iotests/200
@@ -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
diff --git a/tests/qemu-iotests/215 b/tests/qemu-iotests/215
index 55a1874..f99bae7 100755
--- a/tests/qemu-iotests/215
+++ b/tests/qemu-iotests/215
@@ -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
diff --git a/tests/qemu-iotests/225 b/tests/qemu-iotests/225
index fbd7404..c9a334c 100755
--- a/tests/qemu-iotests/225
+++ b/tests/qemu-iotests/225
@@ -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
diff --git a/tests/qemu-iotests/229 b/tests/qemu-iotests/229
index e18a464..866168b 100755
--- a/tests/qemu-iotests/229
+++ b/tests/qemu-iotests/229
@@ -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
diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
index 65b0e42..685356a 100755
--- a/tests/qemu-iotests/232
+++ b/tests/qemu-iotests/232
@@ -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
diff --git a/tests/qemu-iotests/243 b/tests/qemu-iotests/243
index 2b84b89..3dc3b6a 100755
--- a/tests/qemu-iotests/243
+++ b/tests/qemu-iotests/243
@@ -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
diff --git a/tests/qemu-iotests/244 b/tests/qemu-iotests/244
index 0375bc1..1326329 100755
--- a/tests/qemu-iotests/244
+++ b/tests/qemu-iotests/244
@@ -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
diff --git a/tests/qemu-iotests/247 b/tests/qemu-iotests/247
index c853b73..87e37b3 100755
--- a/tests/qemu-iotests/247
+++ b/tests/qemu-iotests/247
@@ -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
diff --git a/tests/qemu-iotests/249 b/tests/qemu-iotests/249
index e4650ec..2b99c97 100755
--- a/tests/qemu-iotests/249
+++ b/tests/qemu-iotests/249
@@ -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
diff --git a/tests/qemu-iotests/252 b/tests/qemu-iotests/252
index f6c8f71..83280c1 100755
--- a/tests/qemu-iotests/252
+++ b/tests/qemu-iotests/252
@@ -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