On Thu, Jun 27, 2013 at 4:43 PM, Stefan Hajnoczi <[email protected]> wrote: > On Thu, Jun 27, 2013 at 4:25 PM, Timothy Scott <[email protected]> wrote: >> - Is there currently a testing suite/procedure for verifying new block >> drivers? > > There is a test suite in tests/qemu-iotests/. You will need to add > support for PVFS2, see how NBD and other protocols were added.
I realized I should give a bit more info to help you get started. tests/qemu-iotests/check is the script to run tests. There are currently around 55 tests which exercise operations using qemu-img(1), qemu-io(1), and sometimes by running QEMU. You can launch it like this: cd tests/qemu-iotests QEMU_PROG=path/to/qemu-system-x86_64 PATH=path/to/qemu-dir:$PATH ./check -qcow2 You can simplify this by putting 'qemu', 'qemu-img', and 'qemu-io' into your PATH. You may wish to symlink 'qemu' to your qemu-system-x86_64 binary. That saves you from typing out the environment variables every time. See the qemu-iotests code for details on how paths are detected. Once you've added PVFS2 support you should be able to do: check -pvfs2 Tests are grouped by specific areas (read-only, read-write, backing file, etc) in tests/qemu-iotests/group. New tests must be added to this file before they become available in check. Tests themselves can restrict themselves to certain formats or host operating systems. This is useful for ensuring that a test is only run against, say qcow2, vmdk, and qed. See the actual test code. Most tests are written in bash. The qemu-iotests framework is also written in bash. The framework is pretty simple: it runs a test and compares the output against a "golden master" output file. If the output matches then the test passes (this requires filtering output in some cases to eliminate parts that differ between runs, from system to system, etc). Some tests are written in Python and use iotests.py, which provides the necessary environment and useful functions. These tests mainly launch QEMU and interact with the QMP monitor (JSON), which is hard to do easily in bash. Stefan
