]> git.proxmox.com Git - mirror_qemu.git/commit
iotests: Add failure matching to common.qemu
authorMax Reitz <mreitz@redhat.com>
Fri, 6 Apr 2018 15:17:30 +0000 (17:17 +0200)
committerMax Reitz <mreitz@redhat.com>
Tue, 15 May 2018 14:15:21 +0000 (16:15 +0200)
commit81c6ddf49a76a663cea16c07a07d51b67c853209
tree34cea042a0663c06a274b3ac5bac0d873dfba057
parent603790ef3aec6a19b1c095188a1d2171934a27de
iotests: Add failure matching to common.qemu

Currently, common.qemu only allows to match for results indicating
success.  The only way to fail is by provoking a timeout.  However,
sometimes we do have a defined failure output and can match for that,
which saves us from having to wait for the timeout in case of failure.
Because failure can sometimes just result in a _notrun in the test, it
is actually important to care about being able to fail quickly.

Also, sometimes we simply do not get any specific output in case of
success.  The only way to handle this currently would be to define an
error message as the string to look for, which means that actual success
results in a timeout.  This is really bad because it unnecessarily slows
down a succeeding test.

Therefore, this patch adds a new parameter $success_or_failure to
_timed_wait_for and _send_qemu_cmd.  Setting this to a non-empty string
makes both commands expect two match parameters: If the first matches,
the function succeeds.  If the second matches, the function fails.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20180406151731.4285-2-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
tests/qemu-iotests/common.qemu