test-nested-aio-poll relies on internal details of how fdmon-poll.c
handles AioContext polling. Skip it when other fdmon implementations are
in use.
Note that this test is only built on POSIX systems so it is safe to
include "util/aio-posix.h".
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
tests/unit/test-nested-aio-poll.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/unit/test-nested-aio-poll.c b/tests/unit/test-nested-aio-poll.c
index d8fd92c43b..45484e745b 100644
--- a/tests/unit/test-nested-aio-poll.c
+++ b/tests/unit/test-nested-aio-poll.c
@@ -15,6 +15,7 @@
#include "qemu/osdep.h"
#include "block/aio.h"
#include "qapi/error.h"
+#include "util/aio-posix.h"
typedef struct {
AioContext *ctx;
@@ -71,6 +72,12 @@ static void test(void)
.ctx = aio_context_new(&error_abort),
};
+ if (td.ctx->fdmon_ops != &fdmon_poll_ops) {
+ /* This test is tied to fdmon-poll.c */
+ g_test_skip("fdmon_poll_ops not in use");
+ return;
+ }
+
qemu_set_current_aio_context(td.ctx);
/* Enable polling */
--
2.49.0