On Wed, Apr 30, 2014 at 10:55:07AM -0400, Jeff Cody wrote: > Prior cover letter details: > > Changes from v4: > > > Patch 1: - Allow option in _send_qemu_cmd() to not exit on error, similar > to _timed_wait_for() (Thanks Fam) > - Renamed the option variable to not exit on error, to make > it clearer the function. > - Updated commit message to reflect the above 2 changes > > Patch 2: - Fixed typo in commit message (thanks Fam) > - Added Fam's reviewed-by > > Patch 3: - Drop unneeded "cluster_size=512" override from image creation > (Thanks Kam) > - Write pattern to the image, and verify the pattern (Thanks Fam) > - Added Fam's reviewed-by > > > > Changes from v3: > > Patch 1: - Make bash version check work with >= 5 as well (Thanks Kevin) > - Suppress error message if killing non-existent PID > - Close QEMU fifo in/out file descriptors on cleanup (Thanks Kevin) > - Remove extra newline at the end of the file (Thanks Kevin) > > Patch 2: - Update commit message to document the commandline change > of accel=qtest due to Patch 1 (Thanks Kevin) > > Patch 3: - Whitespace cleanup (Thanks Kevin) > - Cleanly flush and exit QEMU on vm2, and run > qemu-img check -r all (Thanks Kevin) > - YATNC - Yet Another Test Number Conflict; > move test from 090 to 091 (Thanks Kevin) > > Patches 4,5: Already applied to Kevin's block tree > > > Changes from v2: > > Updated Reviewed-by for Fam and Benoit (Benoit's from the v1 patch, I forgot > to > add those to v2) > > Patch 1: * updated commit message (Thanks Fam) > * Addded '-machine accel=qtest' to qemu launch args (Thanks Fam) > Patch 3: * Moved from test 089 -> test 090 to avoid collision with > Fam's series (Thanks Fam) > > Changes from v1: > > Patch 1: * Fixed commit message, clarified comments (Thanks BenoƮt) > * Changed 'shift' line to be POSIX-friendly, instead of > relying on bashism (Thanks Eric) > * Added ability to repeat qmp or hmp commands an arbitrary > number of times > Patch 3: New patch, for live migration > > Original Description: > > This adds some common functionality to control QEMU for qemu-iotests. > > Additionally, test 085 is updated to use this new functionality. > > Some minor fixups along the way, to clear up spaced pathname issues, > for common.rc, test 019, and test 086. > > > Jeff Cody (3): > block: qemu-iotests - add common.qemu, for bash-controlled qemu tests > block: qemu-iotests - update 085 to use common.qemu > block: qemu-iotests - test for live migration > > tests/qemu-iotests/085 | 73 +++------------ > tests/qemu-iotests/091 | 105 ++++++++++++++++++++++ > tests/qemu-iotests/091.out | 28 ++++++ > tests/qemu-iotests/common.qemu | 200 > +++++++++++++++++++++++++++++++++++++++++ > tests/qemu-iotests/group | 1 + > 5 files changed, 346 insertions(+), 61 deletions(-) > create mode 100755 tests/qemu-iotests/091 > create mode 100644 tests/qemu-iotests/091.out > create mode 100644 tests/qemu-iotests/common.qemu
Although I think bash is the wrong tool for writing these sorts of tests (hint: you had to use eval!), let's take this test case. I will be working on documenting and making iotests.py easier to work with - Kevin has requested the ability to make the QMP interaction diffable so tests can be easily debugged. Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan