[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V2 10/10] tests/qtest: background migration with suspend
From: |
Steve Sistare |
Subject: |
[PATCH V2 10/10] tests/qtest: background migration with suspend |
Date: |
Fri, 30 Jun 2023 06:49:48 -0700 |
Add a test case to verify that the suspended state is handled correctly by
a background migration. The test suspends the src, migrates, then wakes
the dest.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
---
tests/qtest/migration-test.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 8905595..4c0bc95 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -1580,6 +1580,26 @@ static void test_precopy_unix_suspend_notlive(void)
test_precopy_common(&args);
}
+static void *test_bg_suspend_start(QTestState *from, QTestState *to)
+{
+ migrate_set_capability(from, "background-snapshot", true);
+ return NULL;
+}
+
+static void test_bg_suspend(void)
+{
+ g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
+ MigrateCommon args = {
+ .listen_uri = uri,
+ .connect_uri = uri,
+ .live = true, /* runs fast, the src suspends immediately. */
+ .start.suspend_me = true,
+ .start_hook = test_bg_suspend_start
+ };
+
+ test_precopy_common(&args);
+}
+
static void test_precopy_unix_dirty_ring(void)
{
g_autofree char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
@@ -2773,6 +2793,7 @@ int main(int argc, char **argv)
if (is_x86) {
qtest_add_func("/migration/postcopy/suspend",
test_postcopy_suspend);
+ qtest_add_func("/migration/bg/suspend", test_bg_suspend);
}
}
--
1.8.3.1
- [PATCH V2 00/10] fix migration of suspended runstate, Steve Sistare, 2023/06/30
- [PATCH V2 02/10] migration: preserve suspended runstate, Steve Sistare, 2023/06/30
- [PATCH V2 05/10] migration: preserve suspended for bg_migration, Steve Sistare, 2023/06/30
- [PATCH V2 09/10] tests/qtest: postcopy migration with suspend, Steve Sistare, 2023/06/30
- [PATCH V2 03/10] migration: add runstate function, Steve Sistare, 2023/06/30
- [PATCH V2 08/10] tests/qtest: precopy migration with suspend, Steve Sistare, 2023/06/30
- [PATCH V2 10/10] tests/qtest: background migration with suspend,
Steve Sistare <=
- [PATCH V2 07/10] tests/qtest: option to suspend during migration, Steve Sistare, 2023/06/30
- [PATCH V2 01/10] vl: start on wakeup request, Steve Sistare, 2023/06/30
- [PATCH V2 04/10] migration: preserve suspended for snapshot, Steve Sistare, 2023/06/30
- [PATCH V2 06/10] tests/qtest: migration events, Steve Sistare, 2023/06/30