On 2018-02-08 20:23, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > tests/qemu-iotests/206 | 436 > +++++++++++++++++++++++++++++++++++++++++++++ > tests/qemu-iotests/206.out | 209 ++++++++++++++++++++++ > tests/qemu-iotests/group | 1 + > 3 files changed, 646 insertions(+) > create mode 100755 tests/qemu-iotests/206 > create mode 100644 tests/qemu-iotests/206.out
Reviewed-by: Max Reitz <mre...@redhat.com> > diff --git a/tests/qemu-iotests/206 b/tests/qemu-iotests/206 > new file mode 100755 > index 0000000000..0a18b2b19a > --- /dev/null > +++ b/tests/qemu-iotests/206 > @@ -0,0 +1,436 @@ [...] > +# creator > +owner=kw...@redhat.com > + > +seq=`basename $0` > +echo "QA output created by $seq" > + > +here=`pwd` > +status=1 # failure is the default! Hmmm... Didn't we want to remove this boilerplate at some point? > + > +# get standard environment, filters and checks > +. ./common.rc > +. ./common.filter > + > +_supported_fmt qcow2 > +_supported_proto file > +_supported_os Linux > + [...] > +echo > +echo "=== Invalid sizes ===" > +echo > + > +# TODO Negative image sizes aren't handled correctly, but this is a problem > +# with QAPI's implementation of the 'size' type and affects other commands as > +# well. Once this is fixed, we may want to add a test case here. > + > +# 1. Misaligned image size > +# 2. 2^64 - 512 > +# 3. 2^63 = 8 EB (qemu-img enforces image sizes less than this) > +# 4. 2^63 - 512 (generally valid, but qcow2 can't handle images this size) > + > +run_qemu -blockdev driver=file,filename="$TEST_IMG",node-name=node0 <<EOF > +{ "execute": "qmp_capabilities" } > +{ "execute": "x-blockdev-create", > + "arguments": { > + "driver": "$IMGFMT", > + "file": "node0", > + "size": 1234 > + } > +} > +{ "execute": "x-blockdev-create", > + "arguments": { > + "driver": "$IMGFMT", > + "file": "node0", > + "size": 18446744073709551104 I was about to propose $((2**64 - 512)), but then I noticed that yields -512. Nice. > + } > +} > +{ "execute": "x-blockdev-create", > + "arguments": { > + "driver": "$IMGFMT", > + "file": "node0", > + "size": 9223372036854775808 > + } > +} > +{ "execute": "x-blockdev-create", > + "arguments": { > + "driver": "$IMGFMT", > + "file": "node0", > + "size": 9223372036854775296 > + } > +} > +{ "execute": "quit" } > +EOF
signature.asc
Description: OpenPGP digital signature