[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 06/21] tests: convert multifd migration tests to use common he
From: |
Peter Xu |
Subject: |
[PATCH v5 06/21] tests: convert multifd migration tests to use common helper |
Date: |
Mon, 25 Apr 2022 19:38:32 -0400 |
From: Daniel P. Berrangé <berrange@redhat.com>
Most of the multifd migration test logic is common with the rest of the
precopy tests, so it can use the helper without difficulty. The only
exception of the multifd cancellation test which tries to run multiple
migrations in a row.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
tests/qtest/migration-test.c | 77 +++++++++++++++++++-----------------
1 file changed, 40 insertions(+), 37 deletions(-)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 043ae94089..c1b0b3aca4 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -1739,26 +1739,12 @@ static void test_migrate_auto_converge(void)
test_migrate_end(from, to, true);
}
-static void test_multifd_tcp(const char *method)
+static void *
+test_migrate_precopy_tcp_multifd_start_common(QTestState *from,
+ QTestState *to,
+ const char *method)
{
- MigrateStart args = {};
- QTestState *from, *to;
QDict *rsp;
- g_autofree char *uri = NULL;
-
- if (test_migrate_start(&from, &to, "defer", &args)) {
- return;
- }
-
- /*
- * We want to pick a speed slow enough that the test completes
- * quickly, but that it doesn't complete precopy even on a slow
- * machine, so also set the downtime.
- */
- /* 1 ms should make it not converge*/
- migrate_set_parameter_int(from, "downtime-limit", 1);
- /* 1GB/s */
- migrate_set_parameter_int(from, "max-bandwidth", 1000000000);
migrate_set_parameter_int(from, "multifd-channels", 16);
migrate_set_parameter_int(to, "multifd-channels", 16);
@@ -1774,41 +1760,58 @@ static void test_multifd_tcp(const char *method)
" 'arguments': { 'uri': 'tcp:127.0.0.1:0' }}");
qobject_unref(rsp);
- /* Wait for the first serial output from the source */
- wait_for_serial("src_serial");
-
- uri = migrate_get_socket_address(to, "socket-address");
-
- migrate_qmp(from, uri, "{}");
-
- wait_for_migration_pass(from);
+ return NULL;
+}
- migrate_set_parameter_int(from, "downtime-limit", CONVERGE_DOWNTIME);
+static void *
+test_migrate_precopy_tcp_multifd_start(QTestState *from,
+ QTestState *to)
+{
+ return test_migrate_precopy_tcp_multifd_start_common(from, to, "none");
+}
- if (!got_stop) {
- qtest_qmp_eventwait(from, "STOP");
- }
- qtest_qmp_eventwait(to, "RESUME");
+static void *
+test_migrate_precopy_tcp_multifd_zlib_start(QTestState *from,
+ QTestState *to)
+{
+ return test_migrate_precopy_tcp_multifd_start_common(from, to, "zlib");
+}
- wait_for_serial("dest_serial");
- wait_for_migration_complete(from);
- test_migrate_end(from, to, true);
+#ifdef CONFIG_ZSTD
+static void *
+test_migrate_precopy_tcp_multifd_zstd_start(QTestState *from,
+ QTestState *to)
+{
+ return test_migrate_precopy_tcp_multifd_start_common(from, to, "zstd");
}
+#endif /* CONFIG_ZSTD */
static void test_multifd_tcp_none(void)
{
- test_multifd_tcp("none");
+ MigrateCommon args = {
+ .listen_uri = "defer",
+ .start_hook = test_migrate_precopy_tcp_multifd_start,
+ };
+ test_precopy_common(&args);
}
static void test_multifd_tcp_zlib(void)
{
- test_multifd_tcp("zlib");
+ MigrateCommon args = {
+ .listen_uri = "defer",
+ .start_hook = test_migrate_precopy_tcp_multifd_zlib_start,
+ };
+ test_precopy_common(&args);
}
#ifdef CONFIG_ZSTD
static void test_multifd_tcp_zstd(void)
{
- test_multifd_tcp("zstd");
+ MigrateCommon args = {
+ .listen_uri = "defer",
+ .start_hook = test_migrate_precopy_tcp_multifd_zstd_start,
+ };
+ test_precopy_common(&args);
}
#endif
--
2.32.0
- [PATCH v5 00/21] migration: Postcopy Preemption, Peter Xu, 2022/04/25
- [PATCH v5 02/21] tests: add more helper macros for creating TLS x509 certs, Peter Xu, 2022/04/25
- [PATCH v5 01/21] tests: fix encoding of IP addresses in x509 certs, Peter Xu, 2022/04/25
- [PATCH v5 05/21] tests: convert XBZRLE migration test to use common helper, Peter Xu, 2022/04/25
- [PATCH v5 07/21] tests: add multifd migration tests of TLS with PSK credentials, Peter Xu, 2022/04/25
- [PATCH v5 03/21] tests: add migration tests of TLS with PSK credentials, Peter Xu, 2022/04/25
- [PATCH v5 04/21] tests: add migration tests of TLS with x509 credentials, Peter Xu, 2022/04/25
- [PATCH v5 06/21] tests: convert multifd migration tests to use common helper,
Peter Xu <=
- [PATCH v5 08/21] tests: add multifd migration tests of TLS with x509 credentials, Peter Xu, 2022/04/25
- [PATCH v5 09/21] tests: ensure migration status isn't reported as failed, Peter Xu, 2022/04/25
- [PATCH v5 10/21] migration: Add postcopy-preempt capability, Peter Xu, 2022/04/25
- [PATCH v5 11/21] migration: Postcopy preemption preparation on channel creation, Peter Xu, 2022/04/25
- [PATCH v5 12/21] migration: Postcopy preemption enablement, Peter Xu, 2022/04/25
- [PATCH v5 14/21] migration: Create the postcopy preempt channel asynchronously, Peter Xu, 2022/04/25
- [PATCH v5 13/21] migration: Postcopy recover with preempt enabled, Peter Xu, 2022/04/25
- [PATCH v5 15/21] migration: Parameter x-postcopy-preempt-break-huge, Peter Xu, 2022/04/25
- [PATCH v5 17/21] migration: Export tls-[creds|hostname|authz] params to cmdline too, Peter Xu, 2022/04/25
- [PATCH v5 18/21] migration: Enable TLS for preempt channel, Peter Xu, 2022/04/25