From: Nikolay Borisov <nbori...@suse.com> Add basic tests for 'fixed-ram' migration.
Signed-off-by: Nikolay Borisov <nbori...@suse.com> Signed-off-by: Fabiano Rosas <faro...@suse.de> --- tests/qtest/migration-test.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 13e5cdd5a4..84b4c761ad 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1544,6 +1544,26 @@ static void test_precopy_file_stream_ram(void) test_precopy_common(&args); } +static void *migrate_fixed_ram_start(QTestState *from, QTestState *to) +{ + migrate_set_capability(from, "fixed-ram", true); + migrate_set_capability(to, "fixed-ram", true); + + return NULL; +} + +static void test_precopy_file_fixed_ram(void) +{ + g_autofree char *uri = g_strdup_printf("file:%s/migfile", tmpfs); + MigrateCommon args = { + .connect_uri = uri, + .listen_uri = "defer", + .start_hook = migrate_fixed_ram_start, + }; + + test_precopy_common(&args); +} + static void test_precopy_tcp_plain(void) { MigrateCommon args = { @@ -2538,6 +2558,8 @@ int main(int argc, char **argv) qtest_add_func("/migration/precopy/file/stream-ram", test_precopy_file_stream_ram); + qtest_add_func("/migration/precopy/file/fixed-ram", + test_precopy_file_fixed_ram); #ifdef CONFIG_GNUTLS qtest_add_func("/migration/precopy/unix/tls/psk", -- 2.35.3