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 <[email protected]> > --- > 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 <[email protected]>
> + # No more pending events
> + self.do_check_event(None)
> +
> +if __name__ == '__main__':
> + iotests.main(supported_fmts=["raw"])
signature.asc
Description: OpenPGP digital signature
