summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMax Reitz2019-05-22 19:03:52 +0200
committerKevin Wolf2019-06-18 16:41:10 +0200
commitdc68c9d3e80e605c8ff5165a7e352d6efd9f999d (patch)
tree7821f6d53405ddd15fb8a1d77d8518b3e749e986 /tests
parentblock: Ignore loosening perm restrictions failures (diff)
downloadqemu-dc68c9d3e80e605c8ff5165a7e352d6efd9f999d.tar.gz
qemu-dc68c9d3e80e605c8ff5165a7e352d6efd9f999d.tar.xz
qemu-dc68c9d3e80e605c8ff5165a7e352d6efd9f999d.zip
iotests: Test failure to loosen restrictions
Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qemu-iotests/18221
-rw-r--r--tests/qemu-iotests/182.out6
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182
index 3a90ebfbfd..7f494eb9bb 100755
--- a/tests/qemu-iotests/182
+++ b/tests/qemu-iotests/182
@@ -152,6 +152,27 @@ success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \
_cleanup_qemu
+echo
+echo '=== Testing failure to loosen restrictions ==='
+echo
+
+_launch_qemu -drive file=$TEST_IMG,if=none,file.locking=on
+
+_send_qemu_cmd $QEMU_HANDLE \
+ "{'execute': 'qmp_capabilities'}" \
+ 'return'
+
+_cleanup_test_img
+
+# When quitting qemu, it will try to drop its locks on the test image.
+# Because that file no longer exists, it will be unable to do so.
+# However, that is not fatal, so it should just move on.
+_send_qemu_cmd $QEMU_HANDLE \
+ "{'execute': 'quit'}" \
+ 'return'
+
+wait=1 _cleanup_qemu
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/182.out b/tests/qemu-iotests/182.out
index 33d41eea91..ffef23e32b 100644
--- a/tests/qemu-iotests/182.out
+++ b/tests/qemu-iotests/182.out
@@ -15,4 +15,10 @@ Formatting 'TEST_DIR/t.qcow2.overlay', fmt=qcow2 size=197120 backing_file=TEST_D
{"return": {}}
{"return": {}}
{"return": {}}
+
+=== Testing failure to loosen restrictions ===
+
+{"return": {}}
+{"return": {}}
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
*** done