[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 19/19] tests: Add postcopy preempt tests
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v4 19/19] tests: Add postcopy preempt tests |
Date: |
Wed, 20 Apr 2022 12:43:39 +0100 |
User-agent: |
Mutt/2.1.5 (2021-12-30) |
On Thu, Mar 31, 2022 at 11:08:57AM -0400, Peter Xu wrote:
> 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);
On test naming again I think we want these four tests to have names
/migration/postcopy/preempt/plain
/migration/postcopy/preempt/tls/psk
/migration/postcopy/preempt/recovery/plain
/migration/postcopy/preempt/recovery/tls/psk
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- Re: [PATCH v4 19/19] tests: Add postcopy preempt tests,
Daniel P . Berrangé <=