summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/030
AgeCommit message (Collapse)AuthorFilesLines
2013-11-29qemu-iotests: Make test case 030, 040 and 055 deterministicFam Zheng1-5/+11
Pause the drive and start the block job, so we won't miss the block job. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-10-30qemu-iotests: prefill some data to test imageFam Zheng1-0/+4
Case 030 occasionally fails because of block job compltes too fast to be captured by script, and 'unexpected qmp event' of job completion causes the test failure. Simply fill in some data to the test image to make this false alarm less likely to happen. (For other benefits to prefill data to test image, see also commit ab68cdfaa). Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-06-04qemu-iotests: make create_image() commonStefan Hajnoczi1-23/+9
Both 030 and 041 use create_image(). Move it to iotests.py. Also drop ImageStreamingTestCase since the class now has no methods. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-06-04qemu-iotests: make cancel_and_wait() commonStefan Hajnoczi1-15/+0
The cancel_and_wait() function has been duplicated in 030 and 041. Move it into iotests.py and let it return the event so tests can perform additional asserts. Note that 041's cancel_and_wait(wait_ready=True) is replaced by wait_ready_and_cancel(), which uses the new wait_ready() and cancel_and_wait() underneath. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-06-04qemu-iotests: make assert_no_active_block_jobs() commonStefan Hajnoczi1-29/+25
Tests 030 and 041 both use query-block-jobs to check whether any block jobs are active. Make this code common so that 'drive-backup' and other new feature tests will be able to reuse it. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-09-28qemu-iotests: add tests for streaming error handlingPaolo Bonzini1-0/+220
Add a test for each of report/ignore/stop. The tests use blkdebug to generate an error in the middle of a script. The error is recoverable (once = "on") so that we can test resuming a job after stopping for an error. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-09-28qemu-iotests: add test for pausing a streaming operationPaolo Bonzini1-2/+38
These check that a paused streaming job does not advance its offset. Sometimes the new test fails; the map is different between the source and the destination of the streaming because qemu-io does not always pack adjacent clusters that have the same allocated/unallocated state. However, this also happens with the existing test_stream testcase, and is better fixed in qemu-io. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-29qemu-iotests: add backing file smaller than image test caseStefan Hajnoczi1-0/+33
This new test case checks that streaming completes successfully when the backing file is smaller than the image file. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-15qemu-iotests: Fix 030 after switch to GenericErrorKevin Wolf1-4/+2
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-06-15qemu-iotests: start vms in qtest modePaolo Bonzini1-1/+1
This way, they will not execute any VM code at all. However, right now the cancellation test is "relying" on being slowed down by TCG executing BIOS code. So, change the timeouts. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qemu-iotests: fill streaming test image with dataPaolo Bonzini1-1/+12
The TestStreamStop test case is racy; if the job completes before we can cancel it, it fails. If we remove the sleep the job will be canceled before it has even started, and the test succeeds but it is also not testing anything interesting. But if the image is left sparse, then the job has really nothing to do. For qcow2 it will read one L2-table, for raw it will issue a bunch of ioctls. This also falls under "not testing anything interesting", and this may be happening right now (depending on the filesystem) since the file protocol got an is_allocated method. Filling the test image with data ensures that the test covers the intended case. It also slows down the test, which will be particularly important after the next patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-10stream: do not copy unallocated sectors from the basePaolo Bonzini1-2/+3
Unallocated sectors should really never be accessed by the guest, so there's no need to copy them during the streaming process. If they are read by the guest during streaming, guest-initiated copy-on-read will copy them (we're in the base == NULL case, which enables copy on read). If they are read after we disconnect the image from the base, they will read as zeroes anyway. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-10stream: add testcase for partial streamingPaolo Bonzini1-1/+27
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-10stream: fix sectors not allocated testPaolo Bonzini1-0/+1
The test on sectors not allocated can fail if the L1/L2 tables are not on disk yet. Allow tests to shutdown the VM early. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-27qemu-iotests: add block-stream speed value test caseStefan Hajnoczi1-16/+69
Add tests to exercise the InvalidParameter 'speed' error code path, as well as the regular success case for setting the speed. The block-stream 'speed' parameter allows the speed limit of the job to be applied immediately when the job starts instead of issuing a separate block-job-set-speed command later. If the parameter has an invalid value we expect to get an error and the job is not created. It turns out that cancelling a block job is a common operation in these test cases, let's extract a cancel_and_wait() function instead of duplicating the QMP commands. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-04-23qmp: make block job command naming consistentStefan Hajnoczi1-6/+6
The block streaming and job commands used '_' instead of '-' for reasons of compatibility with libvirt, which already included support for the '_' naming. However, the semantics of block_job_cancel have changed and libvirt now needs to handle the new semantics. Since the old semantics were never in a QEMU release we can still rename the commands to use '-' instead of '_'. Libvirt is also happy because the new name can be used to distinguish QEMU binaries that support the latest block-job-cancel semantics from those that include a downstream block_job_cancel command. Therefore, let's apply the QAPI/QMP naming rules to the block streaming and job commands. QEMU 1.1 will be the first release with these commands so no upstream users can break. Note that HMP commands are left with '_' because that is the convention there. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-02-29test: add image streaming testsStefan Hajnoczi1-0/+151
This patch adds a test suite for the image streaming feature. It exercises the 'block_stream', 'block_job_cancel', 'block_job_set_speed', and 'query-block-jobs' QMP commands. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>