]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qemu-iotests: _cleanup_qemu must be called on exit
authorJeff Cody <jcody@redhat.com>
Tue, 18 Apr 2017 19:42:41 +0000 (15:42 -0400)
committerJeff Cody <jcody@redhat.com>
Mon, 24 Apr 2017 19:09:33 +0000 (15:09 -0400)
For the tests that use the common.qemu functions for running a QEMU
process, _cleanup_qemu must be called in the exit function.

If it is not, if the qemu process aborts, then not all of the droppings
are cleaned up (e.g. pidfile, fifos).

This updates those tests that did not have a cleanup in qemu-iotests.

(I swapped spaces for tabs in test 102 as well)

Reported-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Message-id: d59c2f6ad6c1da8b9b3c7f357c94a7122ccfc55a.1492544096.git.jcody@redhat.com

tests/qemu-iotests/028
tests/qemu-iotests/094
tests/qemu-iotests/102
tests/qemu-iotests/109
tests/qemu-iotests/117
tests/qemu-iotests/130
tests/qemu-iotests/140
tests/qemu-iotests/141
tests/qemu-iotests/143
tests/qemu-iotests/156

index 7783e57c716c751a33eab81061d74d6574022aaa..97a88692512fa475a6772a3b3e08b52f095ba204 100755 (executable)
@@ -32,6 +32,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
+    _cleanup_qemu
     rm -f "${TEST_IMG}.copy"
     _cleanup_test_img
 }
index 0ba0b0c3615878bdc2f6c18e075a65bd377cfc20..9aa01e3627c0dce8e0029253498f8ec0299919c4 100755 (executable)
@@ -27,7 +27,14 @@ echo "QA output created by $seq"
 here="$PWD"
 status=1       # failure is the default!
 
-trap "exit \$status" 0 1 2 3 15
+_cleanup()
+{
+    _cleanup_qemu
+    _cleanup_test_img
+    rm -f "$TEST_DIR/source.$IMGFMT"
+}
+
+trap "_cleanup; exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common.rc
@@ -73,8 +80,6 @@ _send_qemu_cmd $QEMU_HANDLE \
 
 wait=1 _cleanup_qemu
 
-_cleanup_test_img
-rm -f "$TEST_DIR/source.$IMGFMT"
 
 # success, all done
 echo '*** done'
index 64b4af9441dc6285af866ac05ac7df1aee854ef1..87db1bb1bf8b1d8c45d28ea63bf2fd9474f3f2dc 100755 (executable)
@@ -25,11 +25,12 @@ seq=$(basename $0)
 echo "QA output created by $seq"
 
 here=$PWD
-status=1       # failure is the default!
+status=1    # failure is the default!
 
 _cleanup()
 {
-       _cleanup_test_img
+    _cleanup_qemu
+    _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
index 927151a2856b4f53f87257c511b00f96a1c3186c..6161633a52f4f2878df5610627006cdcd9dd2bfb 100755 (executable)
@@ -29,6 +29,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
+    _cleanup_qemu
     rm -f $TEST_IMG.src
        _cleanup_test_img
 }
index e955d52de31eeb3b92fe99b05f3982cb6372d087..6c834611824c567d41e83c5c2a8105f992240cb8 100755 (executable)
@@ -29,6 +29,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
+    _cleanup_qemu
        _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index f941fc94a3c4bb29dada2dfd6f8027fb94043a24..e7e43de6d607cce6b9e64505063cc9eed9b3dd3a 100755 (executable)
@@ -31,6 +31,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
+    _cleanup_qemu
     _cleanup_test_img
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index 49f9df4eb0cfacf931759ee4a6383c6b53480278..8c80a5a8661343c4659e7c1294fd42f7c510f5a5 100755 (executable)
@@ -33,6 +33,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
+    _cleanup_qemu
     _cleanup_test_img
     rm -f "$TEST_DIR/nbd"
 }
index 27fb1cc92c6edaff882cfb21291c1198318ae76b..40a3405968069fd2e32d6711fceba37516e8be80 100755 (executable)
@@ -29,6 +29,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
+    _cleanup_qemu
     _cleanup_test_img
     rm -f "$TEST_DIR/{b,m,o}.$IMGFMT"
 }
index ec4ef2221aec774131466a18b7a5657f022f215e..5ff194450786a2495cb1e258f7bee53cf1a61d2b 100755 (executable)
@@ -29,6 +29,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
+    _cleanup_qemu
     rm -f "$TEST_DIR/nbd"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
index 78deaffcc370bf0df229e8f54246e3399e0584af..d799b73e1e3385898546f1dd6262d5d53c3f2eeb 100755 (executable)
@@ -37,6 +37,7 @@ status=1      # failure is the default!
 
 _cleanup()
 {
+    _cleanup_qemu
     rm -f "$TEST_IMG{,.target}{,.backing,.overlay}"
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15