There are 27 pre-copy live migration scenarios being tested. In all of these we force non-convergance and run for one iteration, then let it converge and wait for completion during the second (or following) iterations. At 3 mbps bandwidth limit the first iteration takes a very long time (~30 seconds).
While it is important to test the migration passes and convergance logic, it is overkill to do this for all 27 pre-copy scenarios. The TLS migration scenarios in particular are merely exercising different code paths during connection establishment. To optimize time taken, switch most of the test scenarios to run non-live (ie guest CPUs paused) with no bandwidth limits. This gives a massive speed up for most of the test scenarios. For test coverage the following scenarios are unchanged * Precopy with UNIX sockets * Precopy with UNIX sockets and dirty ring tracking * Precopy with XBZRLE * Precopy with multifd Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> --- tests/qtest/migration-test.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 3b615b0da9..cdc9635f0b 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -574,6 +574,9 @@ typedef struct { /* Optional: set number of migration passes to wait for */ unsigned int iterations; + /* Whether the guest CPUs should be running during migration */ + bool live; + /* Postcopy specific fields */ void *postcopy_data; bool postcopy_preempt; @@ -1329,7 +1332,11 @@ static void test_precopy_common(MigrateCommon *args) return; } - migrate_ensure_non_converge(from); + if (args->live) { + migrate_ensure_non_converge(from); + } else { + migrate_ensure_converge(from); + } if (args->start_hook) { data_hook = args->start_hook(from, to); @@ -1357,16 +1364,20 @@ static void test_precopy_common(MigrateCommon *args) qtest_set_expected_status(to, EXIT_FAILURE); } } else { - if (args->iterations) { - while (args->iterations--) { + if (args->live) { + if (args->iterations) { + while (args->iterations--) { + wait_for_migration_pass(from); + } + } else { wait_for_migration_pass(from); } + + migrate_ensure_converge(from); } else { - wait_for_migration_pass(from); + qtest_qmp_discard_response(from, "{ 'execute' : 'stop'}"); } - migrate_ensure_converge(from); - /* We do this first, as it has a timeout to stop us * hanging forever if migration didn't converge */ wait_for_migration_complete(from); @@ -1375,7 +1386,12 @@ static void test_precopy_common(MigrateCommon *args) qtest_qmp_eventwait(from, "STOP"); } - qtest_qmp_eventwait(to, "RESUME"); + if (!args->live) { + qtest_qmp_discard_response(to, "{ 'execute' : 'cont'}"); + } + if (!got_resume) { + qtest_qmp_eventwait(to, "RESUME"); + } wait_for_serial("dest_serial"); } @@ -1393,6 +1409,7 @@ static void test_precopy_unix_plain(void) MigrateCommon args = { .listen_uri = uri, .connect_uri = uri, + .live = true, }; test_precopy_common(&args); @@ -1408,6 +1425,7 @@ static void test_precopy_unix_dirty_ring(void) }, .listen_uri = uri, .connect_uri = uri, + .live = true, }; test_precopy_common(&args); @@ -1519,6 +1537,7 @@ static void test_precopy_unix_xbzrle(void) .start_hook = test_migrate_xbzrle_start, .iterations = 2, + .live = true, }; test_precopy_common(&args); @@ -1919,6 +1938,7 @@ static void test_multifd_tcp_none(void) MigrateCommon args = { .listen_uri = "defer", .start_hook = test_migrate_precopy_tcp_multifd_start, + .live = true, }; test_precopy_common(&args); } -- 2.40.0