On 30.08.19 18:12, Vladimir Sementsov-Ogievskiy wrote:
> After backup-top filter appearing it's not possible to see dirty
> bitmaps in top node, so use node-name instead.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
> ---
>  tests/qemu-iotests/124        |  83 ++++----
>  tests/qemu-iotests/257        |  49 ++---
>  tests/qemu-iotests/257.out    | 364 +++++++++++++---------------------
>  tests/qemu-iotests/iotests.py |  27 +++
>  4 files changed, 219 insertions(+), 304 deletions(-)

[...]

> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index 84438e837c..1906eb72f3 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -643,6 +643,33 @@ class VM(qtest.QEMUQtestMachine):

[...]

> +    def check_bitmap_status(self, node_name, bitmap_name, fields):
> +        ret = self.get_bitmap(node_name, bitmap_name)
> +
> +        return fields.items() <= ret.items()

Why the <=?  AFAIU, it will compare each of the arrays’ elements one by
one and return true if all of the ones in @fields are less than or equal
to the ones in @ret.

But that would mean that the values given in @fields no longer need to
be equal to the ones in @ret.  On top of that, I suppose if
@fields.items() at some index contains a key that is not equal to the
key in @ret.items() at the same index, luck will determine whether the
comparison passes or not.

Why not just loop through all keys of @fields and check that @fields and
@ret contain the same value for all of them?

Max

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to