iotests.py: Filters for VM.run_job()
authorHanna Reitz <hreitz@redhat.com>
Fri, 18 Mar 2022 12:53:03 +0000 (13:53 +0100)
committerHanna Reitz <hreitz@redhat.com>
Tue, 22 Mar 2022 09:49:54 +0000 (10:49 +0100)
commitda9d88d8e6c163fdcfe858cd05e750a6f1016b88
tree94a5420c26236f6bc4ab757a90480aed10817e4d
parent8f685ac391047a8c253c94b165c3e9b8f184cff2
iotests.py: Filters for VM.run_job()

Allow filters for VM.run_job(), and pass the filters given to
VM.blockdev_create() to it.

(Use this opportunity to annotate VM.run_job()'s parameter types;
unfortunately, for the filter, I could not come up with anything better
than Callable[[Any], Any] that would pass mypy's scrutiny.)

At one point, a plain string is logged, so the filters passed to it must
work fine with plain strings.  The only filters passed to it at this
point are the ones from VM.blockdev_create(), which are
filter_qmp_test_files() (by default) and 207's filter_hash().  Both
cannot handle plain strings yet, but we can make them by amending
filter_qmp() to treat them as plain values with a None key.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220318125304.66131-2-hreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
tests/qemu-iotests/iotests.py