From 50880f25c88f2a629bd68a5fb1a46aa9bf0a2543 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 20 Mar 2018 16:42:12 +0100 Subject: qemu-iotests: Test invalid resize on luks This tests that the .bdrv_truncate implementation for luks doesn't crash for invalid image sizes. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/qemu-iotests/210 | 37 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/210.out | 16 ++++++++++++++++ 2 files changed, 53 insertions(+) (limited to 'tests') diff --git a/tests/qemu-iotests/210 b/tests/qemu-iotests/210 index 96a5213e77..e607c0d296 100755 --- a/tests/qemu-iotests/210 +++ b/tests/qemu-iotests/210 @@ -204,6 +204,43 @@ run_qemu -blockdev driver=file,filename="$TEST_IMG_FILE",node-name=node0 \ { "execute": "quit" } EOF +echo +echo "=== Resize image with invalid sizes ===" +echo + +run_qemu -blockdev driver=file,filename="$TEST_IMG_FILE",node-name=node0 \ + -blockdev driver=luks,file=node0,key-secret=keysec0,node-name=node1 \ + -object secret,id=keysec0,data="foo" <0 size"}} +{"return": {}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + +image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, "key-secret": "keysec0"} +file format: IMGFMT +virtual size: 0 (0 bytes) *** done -- cgit v1.2.3