summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests/group
Commit message (Collapse)AuthorAgeFilesLines
* block: round up file size to nearest sectorHu Tao2014-09-121-0/+1
| | | | | | | | | | | | | | | | Currently the file size requested by user is rounded down to nearest sector, causing the actual file size could be a bit less than the size user requested. Since some formats (like qcow2) record virtual disk size in bytes, this can make the last few bytes cannot be accessed. This patch fixes it by rounding up file size to nearest sector so that the actual file size is no less than the requested file size. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: add multiwrite test casesStefan Hajnoczi2014-08-291-0/+1
| | | | | | | | | | | | | | | This test case covers the basic bdrv_aio_multiwrite() scenarios: 1. Single request 2. Sequential requests (AABB) 3. Superset overlapping requests (AABBAA) 4. Subset overlapping requests (BBAABB) 5. Head overlapping requests (AABB) 6. Tail overlapping requests (BBAA) 7. Disjoint requests (AA BB) Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net>
* qemu-iotests: add test case 101 for short file I/OStefan Hajnoczi2014-08-221-0/+1
| | | | | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Add test for image filename constructionMax Reitz2014-08-201-0/+1
| | | | | | | | | Testing a real in-use protocol such as NBD is hard; testing blkdebug and blkverify in its stead is easier and tests basically the same functionality. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Add test for qcow2's cache optionsMax Reitz2014-08-201-0/+1
| | | | | | | | Add a test which tests various combinations of qcow2's cache options (some of which are valid, some of which are not). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Add more tests to quick groupMax Reitz2014-07-011-19/+19
| | | | | | | | While at it, add some more tests to the quick group (those that run with -nocache in under three seconds on my HDD). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* iotests: Add qemu tests to quick groupMax Reitz2014-07-011-9/+9
| | | | | | | | Now that qemu-iotests-quick.sh supports tests using the qemu binary, we are free to add such tests to the quick group. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* block: add qemu-iotest for resize base during live commitJeff Cody2014-06-271-0/+1
| | | | | | | | | | | | If 'base' is smaller than the overlay image being committed into it, then the base image will be grown in commit_run via bdrv_truncate(). This tests to make sure that this works, and the bdrv_truncate() is not blocked when it shouldn't be. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow1: Check maximum cluster sizeKevin Wolf2014-05-191-0/+1
| | | | | | | | | | | | | | Huge values for header.cluster_bits cause unbounded allocations (e.g. for s->cluster_cache) and crash qemu this way. Less huge values may survive those allocations, but can cause integer overflows later on. The only cluster sizes that qemu can create are 4k (for standalone images) and 512 (for images with backing files), so we can limit it to 64k. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net>
* iotests: Add test for the JSON protocolMax Reitz2014-05-191-0/+1
| | | | | | | | Add a test for the JSON protocol driver. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: qemu-iotests - test for live migrationJeff Cody2014-05-091-0/+1
| | | | | | | | | | | | | This is an initial, simple live migration test from one running VM to another, using monitor commands. This is also an example of using the new common.qemu functions for controlling multiple running qemu instances, for tests that need a live qemu vm. Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* iotests: Discarding compressed clusters on qcow2Max Reitz2014-04-291-0/+1
| | | | | | | | Add a test which discards a compressed cluster on qcow2. This should work without any problems. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* parallels: Fix catalog size integer overflow (CVE-2014-0143)Kevin Wolf2014-04-011-0/+1
| | | | | | | | | | | | | | | | | The first test case would cause a huge memory allocation, leading to a qemu abort; the second one to a too small malloc() for the catalog (smaller than s->catalog_size), which causes a read-only out-of-bounds array access and on big endian hosts an endianess conversion for an undefined memory area. The sample image used here is not an original Parallels image. It was created using an hexeditor on the basis of the struct that qemu uses. Good enough for trying to crash the driver, but not for ensuring compatibility. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* block: vdi bounds check qemu-io testsJeff Cody2014-04-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test checks for proper bounds checking of some VDI input headers. The following is checked: 1. Max image size (1024TB) with the appropriate Blocks In Image value (0x3fffffff) is detected as valid. 2. Image size exceeding max (1024TB) is seen as invalid 3. Valid image size but with Blocks In Image value that is too small fails 4. Blocks In Image size exceeding max (0x3fffffff) is seen as invalid 5. 64MB image, with 64 Blocks In Image, and 1MB Block Size is seen as valid 6. Block Size < 1MB not supported 7. Block Size > 1MB not supported [Max Reitz <mreitz@redhat.com> pointed out that "1MB + 1" in the test case is wrong. Change to "1MB + 64KB" to match the 0x110000 value. --Stefan] Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qcow2: Check header_length (CVE-2014-0144)Kevin Wolf2014-04-011-0/+1
| | | | | | | | This fixes an unbounded allocation for s->unknown_header_fields. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* vpc: Validate block size (CVE-2014-0142)Kevin Wolf2014-04-011-0/+1
| | | | | | | | This fixes some cases of division by zero crashes. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: Support for bochs formatKevin Wolf2014-04-011-0/+1
| | | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: add cloop input validation testsStefan Hajnoczi2014-04-011-0/+1
| | | | | | | | | | Add a cloop format-specific test case. Later patches add tests for input validation to the script. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: remove 085 and 087 from 'quick' groupStefan Hajnoczi2014-03-141-2/+2
| | | | | | | | | | | | The 'quick' group in qemu-iotests are not allowed to run QEMU since we don't know which targets are available. In other words, they may only use qemu-img, qemu-io, and qemu-nbd. Drop 085 and 087 from the 'quick' group since they run QEMU. This makes "make check-block" pass again. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: add 083 NBD client disconnect testsStefan Hajnoczi2014-03-141-0/+1
| | | | | | | | | | | | | This new test case uses nbd-fault-injector.py to simulate broken TCP connections at each stage in the NBD protocol. This way we can exercise block/nbd-client.c's socket error handling code paths. In particular, this serves as a regression test to make sure nbd-client.c doesn't cause an infinite loop by leaving its nbd_receive_reply() fd handler registered after the connection has been closed. This bug was fixed in an earlier patch. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* block: qemu-iotests 085 - live snapshots testsJeff Cody2014-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds tests for live snapshots, both through the single snapshot command, and the transaction group snapshot command. The snapshots are done through the QMP interface, using the following commands for snapshots: Single snapshot: { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'...', 'format': 'qcow2' } }" Group snapshot: { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': '...' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': '...' } } ] } } Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Test a few blockdev-add error casesKevin Wolf2014-03-061-0/+1
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net>
* qemu-iotests: Test progress output for conversionKevin Wolf2014-03-051-0/+1
| | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: add more tests to the "quick" groupPaolo Bonzini2014-02-281-17/+17
| | | | | | | | None of these needs QEMU_PROG, and they all take but a few seconds. We need to point the launching script to qemu-nbd, though. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* quorum: Add unit test.BenoƮt Canet2014-02-211-0/+1
| | | | | | Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Check qemu-img command line parsingKevin Wolf2014-02-211-0/+1
| | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* qemu-iotests: add test for qcow2 preallocation with different cluster sizesHu Tao2014-02-091-0/+1
| | | | | | Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Test pwritev RMW logicKevin Wolf2014-01-241-0/+1
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
* iotests: Test file format nestingMax Reitz2014-01-221-0/+1
| | | | | | | Add a test for nested image formats. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Test new blkdebug/blkverify interfaceMax Reitz2014-01-221-0/+1
| | | | | | | | | | | | Add a test for the new blkdebug/blkverify interface. This test is not written in Python, although it uses QMP. This is because it invokes the qemu-io HMP command, which outputs errors to stderr instead of returning them through QMP. Filtering and testing that output is easier in a shell script than with the Python infrastructure. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: add 058 internal snapshot export with qemu-nbd caseWenchao Xia2013-12-041-0/+1
| | | | | | | | | | | | | This case can't run when IMGPROTO=nbd, since it needs to create some internal snapshot which would fail for EOF write request, even when TEST_IMG is exported with "-f raw" in common.rc, so set _supported_proto to file. _require_command() is changed to tip what util is missing, instead of printing a blank. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: Split qcow2 only cases in 048Fam Zheng2013-12-041-0/+1
| | | | | | | | | | | | | | Format "raw" doesn't always work on certain file systems (e.g. tmpfs). Use qcow2 to make the allocation status explicit and split into a new case. [Resolved merge conflict due to "qemu-io> " prompt filter, added 074 to group file, and fixed up s/048/074/ copy-paste mistake. --Stefan] Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: 033 is fastPaolo Bonzini2013-12-031-1/+1
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: Test qcow2 count_contiguous_clusters()Kevin Wolf2013-11-151-0/+1
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* block: vhdx qemu-iotest - log replay of data sectorJeff Cody2013-11-071-0/+1
| | | | | | | | | | | | | | This tests the replay of a data sector in a VHDX image file. The image file is a 10G dynamic image, with 4MB block size. The image was created with qemu-img, and the log left unplayed by modification of the vhdx image format driver. It was verified under both QEMU and Hyper-V that the image file, post log replay, matched. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: Test case for backing file deletionMax Reitz2013-10-301-0/+1
| | | | | | | | | | | Add a test case for trying to open an image file where it is impossible to open its backing file (in this case, because it was deleted). When doing this, qemu (or qemu-io in this case) should not crash but rather print an appropriate error message. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Test for loading VM state from qcow2Max Reitz2013-10-251-0/+1
| | | | | | | | | Add a test for saving a VM state from a qcow2 image and loading it back (with having restarted qemu in between); this should work without any problems. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Check autodel behaviour for device_delKevin Wolf2013-10-111-0/+1
| | | | | | | | | Block devices creates with -drive and drive_add should automatically disappear if the guest device is unplugged. blockdev-add ones shouldn't. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* block: qemu-iotests for vhdx, read sample dynamic imageJeff Cody2013-10-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This adds the VHDX format to the qemu-iotests format, and adds a read test. The test reads from an existing sample image, that was created with Hyper-V under Windwos Server 2012. The image file is a 1GB dynamic image, with 32MB blocks. The pattern 0xa5 exists from 0MB-33MB (past a block size boundary) The pattern 0x96 exists from 33MB-66MB (past another block boundary, and leaving a partial blank block) From 66MB-1024MB, all reads should return 0. Although 1GB dynamic image with 66MB of data, the bzip2'ed image file size is only 874 bytes. This also adds in the IMGFMT_GENERIC flag, so r/o images can be tested (e.g. ./check -vhdx) without failing tests that assume r/w support. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Discard preallocated zero clustersMax Reitz2013-10-111-0/+1
| | | | | | | | Add a new test case for discarding preallocated zero clusters; doing this should not result in any leaks. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Additional info from qemu-img infoMax Reitz2013-10-111-0/+1
| | | | | | | | | | | Add a test for the additional information now provided by qemu-img info when used on qcow2 images. It also tests the qemu QMP output from the query-block command when running qemu with different runtime options than specified in the image (ImageInfoSpecific should always refer to the image). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: add 057 internal snapshot for block device test caseWenchao Xia2013-09-121-0/+1
| | | | | | | Create in transaction and deletion in single command will be tested. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotest: qcow2 image option amendmentMax Reitz2013-09-121-0/+1
| | | | | | | Add tests for qemu-img amend on qcow2 image files. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* add qemu-img convert -n option (skip target volume creation)Alexandre Derumier2013-09-061-0/+1
| | | | | | | | | | | | | | Add a -n option to skip volume creation on qemu-img convert. This is useful for targets such as rbd / ceph, where the target volume may already exist; we cannot always rely on qemu-img convert to create the image, as dependent on the output format, there may be parameters which are not possible to specify through the qemu-img convert command line. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Alexandre Derumier <aderumier@odiso.com> Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: Overlapping cluster allocationsMax Reitz2013-09-021-0/+1
| | | | | | | A new test on corrupted images with overlapping cluster allocations. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Snapshotting zero clustersMax Reitz2013-08-301-0/+1
| | | | | | | | This test creates an image with unallocated zero clusters, then creates a snapshot. Afterwards, there should be neither any errors nor leaks. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Revert "block: Disable driver-specific options for 1.6"Kevin Wolf2013-08-301-1/+1
| | | | | | This reverts commit 8afaefb8919dc8746a57c450a758717c516c7b0a. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: add empty test case for vmdkFam Zheng2013-08-061-0/+1
| | | | | | | Will add vmdk specific tests later here. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Disable driver-specific options for 1.6Kevin Wolf2013-08-021-1/+1
| | | | | | | | | | | | | We don't want to commit to the API yet before everything is worked out. Like already for 1.5, disable it again for the 1.6 release. This commit is meant to be reverted after the 1.6 release. The disabling of the driver-specific options is achieved by applying the old checks while parsing the command line. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* Add tests for sync modes 'TOP' and 'NONE'Ian Main2013-07-261-0/+1
| | | | | | | | | This patch adds tests for sync modes top and none. Test for 'TOP' is separated out as it requires a backing file. Also added a test for invalid format. Signed-off-by: Ian Main <imain@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud