]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
iotests: Fix cleanup path in some tests
authorMax Reitz <mreitz@redhat.com>
Mon, 24 Feb 2020 17:16:31 +0000 (18:16 +0100)
committerMax Reitz <mreitz@redhat.com>
Tue, 24 Mar 2020 10:57:38 +0000 (11:57 +0100)
Some iotests leave behind some external data file when run for qcow2
with -o data_file.  Fix that.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200224171631.384314-1-mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
tests/qemu-iotests/085
tests/qemu-iotests/087
tests/qemu-iotests/279

index 46981dbb64aef1d58a8a94e286930702769d88cb..dd3c993a2d579ed484403afe303673f3600de5ed 100755 (executable)
@@ -39,6 +39,7 @@ SNAPSHOTS=10
 _cleanup()
 {
     _cleanup_qemu
+    _cleanup_test_img
     for i in $(seq 1 ${SNAPSHOTS})
     do
         _rm_test_img "${TEST_DIR}/${i}-${snapshot_virt0}"
index d6c861341950bf644b01bddb1257826966a5f822..bdfdad3454e3b5e1f950f4bc55baff58210a817e 100755 (executable)
@@ -26,6 +26,12 @@ echo "QA output created by $seq"
 
 status=1       # failure is the default!
 
+_cleanup()
+{
+    _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
 # get standard environment, filters and checks
 . ./common.rc
 . ./common.filter
index 30d29b1cb2aac11b38497624f813e028e966b440..75a4747e6bcde3957e7b6b04fcb7ad2836915900 100755 (executable)
@@ -26,7 +26,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