[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/27] tests/qtest/migration: Add tests for mapped-ram file-based
From: |
peterx |
Subject: |
[PULL 14/27] tests/qtest/migration: Add tests for mapped-ram file-based migration |
Date: |
Mon, 4 Mar 2024 09:26:21 +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-12-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
---
tests/qtest/migration-test.c | 59 ++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 8c35f3457b..4c5551f7d0 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -2200,6 +2200,14 @@ static void *test_mode_reboot_start(QTestState *from,
QTestState *to)
return NULL;
}
+static void *migrate_mapped_ram_start(QTestState *from, QTestState *to)
+{
+ migrate_set_capability(from, "mapped-ram", true);
+ migrate_set_capability(to, "mapped-ram", true);
+
+ return NULL;
+}
+
static void test_mode_reboot(void)
{
g_autofree char *uri = g_strdup_printf("file:%s/%s", tmpfs,
@@ -2214,6 +2222,32 @@ static void test_mode_reboot(void)
test_file_common(&args, true);
}
+static void test_precopy_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_mapped_ram_start,
+ };
+
+ test_file_common(&args, false);
+}
+
+static void test_precopy_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_mapped_ram_start,
+ };
+
+ test_file_common(&args, true);
+}
+
static void test_precopy_tcp_plain(void)
{
MigrateCommon args = {
@@ -2462,6 +2496,13 @@ static void *migrate_precopy_fd_file_start(QTestState
*from, QTestState *to)
return NULL;
}
+static void *migrate_fd_file_mapped_ram_start(QTestState *from, QTestState *to)
+{
+ migrate_mapped_ram_start(from, to);
+
+ return migrate_precopy_fd_file_start(from, to);
+}
+
static void test_migrate_precopy_fd_file(void)
{
MigrateCommon args = {
@@ -2472,6 +2513,17 @@ static void test_migrate_precopy_fd_file(void)
};
test_file_common(&args, true);
}
+
+static void test_migrate_precopy_fd_file_mapped_ram(void)
+{
+ MigrateCommon args = {
+ .listen_uri = "defer",
+ .connect_uri = "fd:fd-mig",
+ .start_hook = migrate_fd_file_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)
@@ -3519,6 +3571,11 @@ int main(int argc, char **argv)
migration_test_add("/migration/mode/reboot", test_mode_reboot);
}
+ migration_test_add("/migration/precopy/file/mapped-ram",
+ test_precopy_file_mapped_ram);
+ migration_test_add("/migration/precopy/file/mapped-ram/live",
+ test_precopy_file_mapped_ram_live);
+
#ifdef CONFIG_GNUTLS
migration_test_add("/migration/precopy/unix/tls/psk",
test_precopy_unix_tls_psk);
@@ -3580,6 +3637,8 @@ int main(int argc, char **argv)
test_migrate_precopy_fd_socket);
migration_test_add("/migration/precopy/fd/file",
test_migrate_precopy_fd_file);
+ migration_test_add("/migration/precopy/fd/file/mapped-ram",
+ test_migrate_precopy_fd_file_mapped_ram);
#endif
migration_test_add("/migration/validate_uuid", test_validate_uuid);
migration_test_add("/migration/validate_uuid_error",
--
2.44.0
- [PULL 05/27] io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file, (continued)
- [PULL 05/27] io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file, peterx, 2024/03/03
- [PULL 03/27] tests/migration: Set compression level in migration tests, peterx, 2024/03/03
- [PULL 07/27] io: implement io_pwritev/preadv for QIOChannelFile, peterx, 2024/03/03
- [PULL 08/27] io: fsync before closing a file channel, peterx, 2024/03/03
- [PULL 06/27] io: Add generic pwritev/preadv interface, peterx, 2024/03/03
- [PULL 10/27] migration/ram: Introduce 'mapped-ram' migration capability, peterx, 2024/03/03
- [PULL 11/27] migration: Add mapped-ram URI compatibility check, peterx, 2024/03/03
- [PULL 09/27] migration/qemu-file: add utility methods for working with seekable channels, peterx, 2024/03/03
- [PULL 12/27] migration/ram: Add outgoing 'mapped-ram' migration, peterx, 2024/03/03
- [PULL 13/27] migration/ram: Add incoming 'mapped-ram' migration, peterx, 2024/03/03
- [PULL 14/27] tests/qtest/migration: Add tests for mapped-ram file-based migration,
peterx <=
- [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, 2024/03/03