qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests/migration-test: Check error-desc after pre-switch cancel tests
@ 2025-10-31 16:49 Peter Xu
  2025-11-04 12:35 ` Juraj Marcin
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Xu @ 2025-10-31 16:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fabiano Rosas, Juraj Marcin, peterx

error-desc should present on dest QEMU after migration failed on dest when
exit-on-error is set to FALSE.  Check the error message.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 tests/qtest/migration/precopy-tests.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/qtest/migration/precopy-tests.c b/tests/qtest/migration/precopy-tests.c
index 57ca623de5..5f02e35324 100644
--- a/tests/qtest/migration/precopy-tests.c
+++ b/tests/qtest/migration/precopy-tests.c
@@ -759,6 +759,14 @@ static void test_cancel_src_after_none(QTestState *from, QTestState *to,
     wait_for_migration_complete(to);
 }
 
+static void assert_migration_error(QTestState *vm)
+{
+    QDict *rep = migrate_query(vm);
+
+    g_assert(qdict_get_str(rep, "error-desc"));
+    qobject_unref(rep);
+}
+
 static void test_cancel_src_pre_switchover(QTestState *from, QTestState *to,
                                            const char *uri, const char *phase)
 {
@@ -784,6 +792,7 @@ static void test_cancel_src_pre_switchover(QTestState *from, QTestState *to,
 
     wait_for_migration_status(to, "failed",
                               (const char * []) { "completed", NULL });
+    assert_migration_error(to);
 }
 
 static void test_cancel_src_after_status(void *opaque)
-- 
2.50.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-11-06 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 16:49 [PATCH] tests/migration-test: Check error-desc after pre-switch cancel tests Peter Xu
2025-11-04 12:35 ` Juraj Marcin
2025-11-05 19:52   ` Peter Xu
2025-11-06 11:27     ` Juraj Marcin
2025-11-06 16:15       ` Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).