Commit Graph

255 Commits

Author SHA1 Message Date
Paolo Bonzini 4f45056841 qemu-iotests: map underscore to dash in QMP argument names
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-09-28 19:40:56 +02:00
Paolo Bonzini 0fd05e8dd1 qemu-iotests: start vms in qtest mode
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-15 14:03:43 +02:00
Paolo Bonzini 863a5d042f stream: fix sectors not allocated test
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-10 10:32:13 +02:00
Paolo Bonzini c68b039aa9 qemu-iotests: strip spaces from qemu-img/qemu-io/qemu command lines
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-05-10 10:32:11 +02:00
Stefan Hajnoczi f345cfd019 qemu-iotests: add iotests Python module
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>
2012-02-29 15:48:44 +01:00