summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/iotests.py
AgeCommit message (Collapse)AuthorFilesLines
2013-12-04qemu-iotests: Honour cache mode in iotests.pyFam Zheng1-1/+2
This will allow overriding cache mode from the "-c mode" option. 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>
2013-11-29qemu-iotest: Add pause_drive and resume_drive methodsFam Zheng1-1/+17
They wrap blkdebug "break" and "remove_break". Add optional argument "resume" to cancel_and_wait(). Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-10-11qemu-iotests: Additional info from qemu-img infoMax Reitz1-0/+4
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>
2013-09-26qemu-iotests: fix qmp.py search pathFam Zheng1-1/+1
QMP/qmp.py is renamed to scripts/qmp/qmp.py, fix the search path in iotests.py. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-09-12qemu-iotests: add infrastructure of fd passing via SCMWenchao Xia1-0/+23
This patch make use of the compiled scm helper program to transfer fd via unix socket at runtime. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-07-26Add tests for sync modes 'TOP' and 'NONE'Ian Main1-0/+5
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>
2013-06-28qemu-iotests: extract wait_until_completed() into iotests.pyStefan Hajnoczi1-0/+15
The 'drive-mirror' tests often issue 'block-job-complete' and wait for the QMP completion event. Other types of block jobs also want to wait for completion but they may not need to issue 'block-job-complete'. Extract wait_until_completed() from 041 and put it into iotests.py. Return the QMP event object so the caller can make additional assertions, if necessary. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-06-04qemu-iotests: make create_image() commonStefan Hajnoczi1-0/+11
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 compare_images() commonStefan Hajnoczi1-0/+5
The iotests.compare_images() function returns True if two image files have the identical data. Previously this was implemented by converting images to raw and then comparing their contents using Python. Since "qemu-img compare" is now available and is more efficient, switch to it. This function will be reused by the 'drive-backup' test case. 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-0/+18
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-0/+4
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-12-11tests: Add tests for fdsetsCorey Bryant1-0/+12
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-07Fix spelling in comments and documentationStefan Weil1-1/+1
These spelling bugs were found by codespell: supressing -> suppressing transfered -> transferred Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-11-14qemu-iotests: qcow2: Test growing large refcount tableKevin Wolf1-1/+5
Actually writing all the content with 512 byte sector size would take forever, therefore build the image file with a Python script and use qemu-io for the last write that actually triggers the refcount table growth. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-10-24qemu-iotests: add testcases for mirroring on-source-error/on-target-errorPaolo Bonzini1-0/+4
The new options are tested with blkdebug on both the source and the target. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-09-28qemu-iotests: add tests for streaming error handlingPaolo Bonzini1-0/+7
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: map underscore to dash in QMP argument namesPaolo Bonzini1-1/+7
iotests.py provides a convenience function that uses Python keyword arguments to represent QMP command arguments. However, almost all QMP commands use dashes for argument names (the sole exception is block_set_io_throttle), and dashes are not allowed in a keyword argument name. Hence provide automatic conversion of underscores to dashes. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qemu-iotests: start vms in qtest modePaolo Bonzini1-1/+3
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-05-10stream: fix sectors not allocated testPaolo Bonzini1-4/+6
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-05-10qemu-iotests: strip spaces from qemu-img/qemu-io/qemu command linesPaolo Bonzini1-3/+3
A trailing space is left when qemu-img has no arguments, for example if -nocache is not used. This becomes an empty argument after split() and causes qemu-io to fail. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29qemu-iotests: add iotests Python moduleStefan Hajnoczi1-0/+164
Block layer tests that involve QMP commands rather than qemu-img or qemu-io are not well-suited for shell scripting. This patch adds a Python module which allows tests to be written in Python instead. The basic API is: VM - class for launching and interacting with a VM QMPTestCase - abstract base class for tests that use QMP qemu_img() - wrapper function for invoking qemu-img qemu_io() - wrapper function for invoking qemu-io imgfmt - the image format under test (e.g. qcow2, qed) test_dir - scratch directory path for temporary files main() - entry point for running tests Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>