[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 19/19] tests: Add postcopy preempt tests
From: |
Peter Xu |
Subject: |
[PATCH v4 19/19] tests: Add postcopy preempt tests |
Date: |
Thu, 31 Mar 2022 11:08:57 -0400 |
Four tests are added for preempt mode:
- Postcopy default
- Postcopy tls
- Postcopy recovery
- Postcopy tls+recovery
Signed-off-by: Peter Xu <peterx@redhat.com>
---
tests/qtest/migration-test.c | 49 ++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 7288c64e97..7188503ae1 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -477,6 +477,7 @@ typedef struct {
*/
bool hide_stderr;
bool use_shmem;
+ bool postcopy_preempt;
/* only launch the target process */
bool only_target;
/* Use dirty ring if true; dirty logging otherwise */
@@ -992,6 +993,11 @@ static int migrate_postcopy_prepare(QTestState **from_ptr,
migrate_set_capability(to, "postcopy-ram", true);
migrate_set_capability(to, "postcopy-blocktime", true);
+ if (args->postcopy_preempt) {
+ migrate_set_capability(from, "postcopy-preempt", true);
+ migrate_set_capability(to, "postcopy-preempt", true);
+ }
+
/* 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.
@@ -1058,6 +1064,25 @@ static void test_postcopy_tls(void)
test_postcopy_common(&args);
}
+static void test_postcopy_preempt(void)
+{
+ MigrateStart args = {
+ .postcopy_preempt = true,
+ };
+
+ test_postcopy_common(&args);
+}
+
+static void test_postcopy_preempt_tls(void)
+{
+ MigrateStart args = {
+ .postcopy_preempt = true,
+ .postcopy_tls = true,
+ };
+
+ test_postcopy_common(&args);
+}
+
static void test_postcopy_recovery_common(MigrateStart *args)
{
QTestState *from, *to;
@@ -1134,6 +1159,24 @@ static void test_postcopy_recovery_tls(void)
test_postcopy_recovery_common(&args);
}
+static void test_postcopy_preempt_recovery(void)
+{
+ MigrateStart args = { .postcopy_preempt = true };
+
+ test_postcopy_recovery_common(&args);
+}
+
+/* This contains preempt+recovery+tls test altogether */
+static void test_postcopy_preempt_all(void)
+{
+ MigrateStart args = {
+ .postcopy_preempt = true,
+ .postcopy_tls = true,
+ };
+
+ test_postcopy_recovery_common(&args);
+}
+
static void test_baddest(void)
{
MigrateStart args = {
@@ -2176,6 +2219,12 @@ int main(int argc, char **argv)
qtest_add_func("/migration/postcopy/unix", test_postcopy);
qtest_add_func("/migration/postcopy/recovery", test_postcopy_recovery);
+ qtest_add_func("/migration/postcopy/preempt/unix", test_postcopy_preempt);
+ qtest_add_func("/migration/postcopy/preempt/recovery",
+ test_postcopy_preempt_recovery);
+ qtest_add_func("/migration/postcopy/preempt/tls",
test_postcopy_preempt_tls);
+ qtest_add_func("/migration/postcopy/preempt/tls+recovery",
+ test_postcopy_preempt_all);
#ifdef CONFIG_GNUTLS
qtest_add_func("/migration/postcopy/tls", test_postcopy_tls);
qtest_add_func("/migration/postcopy/tls/recovery",
test_postcopy_recovery_tls);
--
2.32.0
- [PATCH v4 11/19] migration: Postcopy recover with preempt enabled, (continued)
- [PATCH v4 11/19] migration: Postcopy recover with preempt enabled, Peter Xu, 2022/03/31
- [PATCH v4 14/19] migration: Add helpers to detect TLS capability, Peter Xu, 2022/03/31
- [PATCH v4 17/19] tests: Add postcopy tls migration test, Peter Xu, 2022/03/31
- [PATCH v4 15/19] migration: Export tls-[creds|hostname|authz] params to cmdline too, Peter Xu, 2022/03/31
- [PATCH v4 10/19] migration: Postcopy preemption enablement, Peter Xu, 2022/03/31
- [PATCH v4 18/19] tests: Add postcopy tls recovery migration test, Peter Xu, 2022/03/31
- [PATCH v4 13/19] migration: Parameter x-postcopy-preempt-break-huge, Peter Xu, 2022/03/31
- [PATCH v4 03/19] migration: Add pss.postcopy_requested status, Peter Xu, 2022/03/31
- [PATCH v4 01/19] migration: Postpone releasing MigrationState.hostname, Peter Xu, 2022/03/31
- [PATCH v4 02/19] migration: Drop multifd tls_hostname cache, Peter Xu, 2022/03/31
- [PATCH v4 19/19] tests: Add postcopy preempt tests,
Peter Xu <=
- [PATCH v4 16/19] migration: Enable TLS for preempt channel, Peter Xu, 2022/03/31