[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 37/37] tests: Add test case for aio_disable_external
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 37/37] tests: Add test case for aio_disable_external |
Date: |
Fri, 23 Oct 2015 19:01:24 +0200 |
From: Fam Zheng <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/test-aio.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/tests/test-aio.c b/tests/test-aio.c
index 03cd45d..1623803 100644
--- a/tests/test-aio.c
+++ b/tests/test-aio.c
@@ -374,6 +374,29 @@ static void test_flush_event_notifier(void)
event_notifier_cleanup(&data.e);
}
+static void test_aio_external_client(void)
+{
+ int i, j;
+
+ for (i = 1; i < 3; i++) {
+ EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true
};
+ event_notifier_init(&data.e, false);
+ aio_set_event_notifier(ctx, &data.e, true, event_ready_cb);
+ event_notifier_set(&data.e);
+ for (j = 0; j < i; j++) {
+ aio_disable_external(ctx);
+ }
+ for (j = 0; j < i; j++) {
+ assert(!aio_poll(ctx, false));
+ assert(event_notifier_test_and_clear(&data.e));
+ event_notifier_set(&data.e);
+ aio_enable_external(ctx);
+ }
+ assert(aio_poll(ctx, false));
+ event_notifier_cleanup(&data.e);
+ }
+}
+
static void test_wait_event_notifier_noflush(void)
{
EventNotifierTestData data = { .n = 0 };
@@ -832,6 +855,7 @@ int main(int argc, char **argv)
g_test_add_func("/aio/event/wait", test_wait_event_notifier);
g_test_add_func("/aio/event/wait/no-flush-cb",
test_wait_event_notifier_noflush);
g_test_add_func("/aio/event/flush", test_flush_event_notifier);
+ g_test_add_func("/aio/external-client", test_aio_external_client);
g_test_add_func("/aio/timer/schedule", test_timer_schedule);
g_test_add_func("/aio-gsource/flush", test_source_flush);
--
1.8.3.1
- [Qemu-devel] [PULL 20/37] block: Fail requests to empty BlockBackend, (continued)
- [Qemu-devel] [PULL 20/37] block: Fail requests to empty BlockBackend, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 24/37] blockdev: Do not create BDS for empty drive, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 30/37] dataplane: Mark host notifiers' client type as "external", Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 28/37] aio: Add "is_external" flag for event handlers, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 33/37] block: Add "drained begin/end" for transactional external snapshot, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 36/37] block: Add "drained begin/end" for internal snapshot, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 27/37] throttle: Remove throttle_group_lock/unlock(), Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 35/37] block: Add "drained begin/end" for transactional blockdev-backup, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 29/37] nbd: Mark fd handlers client type as "external", Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 32/37] block: Introduce "drained begin/end" API, Kevin Wolf, 2015/10/23
- [Qemu-devel] [PULL 37/37] tests: Add test case for aio_disable_external,
Kevin Wolf <=
- [Qemu-devel] [PULL 34/37] block: Add "drained begin/end" for transactional backup, Kevin Wolf, 2015/10/23
- Re: [Qemu-devel] [PULL 00/37] Block layer patches, Peter Maydell, 2015/10/26