[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH 4/4] iotests: Add test for QMP even
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH 4/4] iotests: Add test for QMP event rates |
Date: |
Wed, 9 Mar 2016 18:36:22 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 09.03.2016 17:11, Alberto Garcia wrote:
> This test verifies that the rate-limited QMP events are emitted at a
> maximum rate of 1 per second as defined in monitor_qapi_event_conf in
> monitor.c
>
> It also checks that QUORUM_REPORT_BAD events generated from different
> nodes are kept in separate queues so they don't mask each other.
>
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
> tests/qemu-iotests/146 | 129
> +++++++++++++++++++++++++++++++++++++++++++++
> tests/qemu-iotests/146.out | 5 ++
> tests/qemu-iotests/group | 1 +
> 3 files changed, 135 insertions(+)
> create mode 100644 tests/qemu-iotests/146
> create mode 100644 tests/qemu-iotests/146.out
>
> diff --git a/tests/qemu-iotests/146 b/tests/qemu-iotests/146
> new file mode 100644
> index 0000000..30bc379
> --- /dev/null
> +++ b/tests/qemu-iotests/146
[...]
> + # I/O errors in different children: all events are emitted
> + delay = 2 * event_rate
> + for i in range(len(imgs)):
> + self.vm.hmp_qemu_io("drive0", "aio_read %d %d" %
> + ((offset + i) * sector_size, sector_size))
> + self.vm.qtest("clock_step %d" % delay)
> + self.do_check_event('img%d' % i, offset + i)
> +
A self.vm.qtest("clock_step %d" % (2 * event_rate)) may be useful here,
but it's not necessary.
Reviewed-by: Max Reitz <address@hidden>
> + # No more pending events
> + self.do_check_event(None)
> +
> +if __name__ == '__main__':
> + iotests.main(supported_fmts=["raw"])
signature.asc
Description: OpenPGP digital signature