[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/27] tests/qtest/migration: Add a multifd + mapped-ram migration
From: |
peterx |
Subject: |
[PULL 26/27] tests/qtest/migration: Add a multifd + mapped-ram migration test |
Date: |
Mon, 4 Mar 2024 09:26:33 +0800 |
From: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240229153017.2221-24-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
---
tests/qtest/migration-test.c | 68 ++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 4c5551f7d0..4023d808f9 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -2248,6 +2248,46 @@ static void test_precopy_file_mapped_ram(void)
test_file_common(&args, true);
}
+static void *migrate_multifd_mapped_ram_start(QTestState *from, QTestState *to)
+{
+ migrate_mapped_ram_start(from, to);
+
+ migrate_set_parameter_int(from, "multifd-channels", 4);
+ migrate_set_parameter_int(to, "multifd-channels", 4);
+
+ migrate_set_capability(from, "multifd", true);
+ migrate_set_capability(to, "multifd", true);
+
+ return NULL;
+}
+
+static void test_multifd_file_mapped_ram_live(void)
+{
+ g_autofree char *uri = g_strdup_printf("file:%s/%s", tmpfs,
+ FILE_TEST_FILENAME);
+ MigrateCommon args = {
+ .connect_uri = uri,
+ .listen_uri = "defer",
+ .start_hook = migrate_multifd_mapped_ram_start,
+ };
+
+ test_file_common(&args, false);
+}
+
+static void test_multifd_file_mapped_ram(void)
+{
+ g_autofree char *uri = g_strdup_printf("file:%s/%s", tmpfs,
+ FILE_TEST_FILENAME);
+ MigrateCommon args = {
+ .connect_uri = uri,
+ .listen_uri = "defer",
+ .start_hook = migrate_multifd_mapped_ram_start,
+ };
+
+ test_file_common(&args, true);
+}
+
+
static void test_precopy_tcp_plain(void)
{
MigrateCommon args = {
@@ -2524,6 +2564,25 @@ static void test_migrate_precopy_fd_file_mapped_ram(void)
};
test_file_common(&args, true);
}
+
+static void *migrate_multifd_fd_mapped_ram_start(QTestState *from,
+ QTestState *to)
+{
+ migrate_multifd_mapped_ram_start(from, to);
+ return migrate_precopy_fd_file_start(from, to);
+}
+
+static void test_multifd_fd_mapped_ram(void)
+{
+ MigrateCommon args = {
+ .connect_uri = "fd:fd-mig",
+ .listen_uri = "defer",
+ .start_hook = migrate_multifd_fd_mapped_ram_start,
+ .finish_hook = test_migrate_fd_finish_hook
+ };
+
+ test_file_common(&args, true);
+}
#endif /* _WIN32 */
static void do_test_validate_uuid(MigrateStart *args, bool should_fail)
@@ -3576,6 +3635,15 @@ int main(int argc, char **argv)
migration_test_add("/migration/precopy/file/mapped-ram/live",
test_precopy_file_mapped_ram_live);
+ migration_test_add("/migration/multifd/file/mapped-ram",
+ test_multifd_file_mapped_ram);
+ migration_test_add("/migration/multifd/file/mapped-ram/live",
+ test_multifd_file_mapped_ram_live);
+#ifndef _WIN32
+ migration_test_add("/migration/multifd/fd/mapped-ram",
+ test_multifd_fd_mapped_ram);
+#endif
+
#ifdef CONFIG_GNUTLS
migration_test_add("/migration/precopy/unix/tls/psk",
test_precopy_unix_tls_psk);
--
2.44.0
- [PULL 14/27] tests/qtest/migration: Add tests for mapped-ram file-based migration, (continued)
- [PULL 14/27] tests/qtest/migration: Add tests for mapped-ram file-based migration, peterx, 2024/03/03
- [PULL 16/27] migration/multifd: Decouple recv method from pages, peterx, 2024/03/03
- [PULL 15/27] migration/multifd: Rename MultiFDSend|RecvParams::data to compress_data, peterx, 2024/03/03
- [PULL 21/27] migration/multifd: Add incoming QIOChannelFile support, peterx, 2024/03/03
- [PULL 18/27] migration/multifd: Allow receiving pages without packets, peterx, 2024/03/03
- [PULL 24/27] migration/multifd: Support incoming mapped-ram stream format, peterx, 2024/03/03
- [PULL 17/27] migration/multifd: Allow multifd without packets, peterx, 2024/03/03
- [PULL 19/27] migration/multifd: Add a wrapper for channels_created, peterx, 2024/03/03
- [PULL 20/27] migration/multifd: Add outgoing QIOChannelFile support, peterx, 2024/03/03
- [PULL 23/27] migration/multifd: Support outgoing mapped-ram stream format, peterx, 2024/03/03
- [PULL 26/27] tests/qtest/migration: Add a multifd + mapped-ram migration test,
peterx <=
- [PULL 25/27] migration/multifd: Add mapped-ram support to fd: URI, peterx, 2024/03/03
- [PULL 22/27] migration/multifd: Prepare multifd sync for mapped-ram migration, peterx, 2024/03/03
- [PULL 27/27] migration/multifd: Document two places for mapped-ram, peterx, 2024/03/03
- Re: [PULL 00/27] Migration next patches, Peter Maydell, 2024/03/05