From: Fabiano Rosas <farosas@suse.de>
To: qemu-devel@nongnu.org
Cc: "Daniel P . Berrangé" <berrange@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Peter Xu" <peterx@redhat.com>,
"Leonardo Bras" <leobras@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH v1 2/5] tests/qtest/migration: Add infrastructure to skip tests on older QEMUs
Date: Fri, 08 Dec 2023 12:02:19 -0300 [thread overview]
Message-ID: <87zfykybyc.fsf@suse.de> (raw)
In-Reply-To: <20231207155809.25673-3-farosas@suse.de>
Fabiano Rosas <farosas@suse.de> writes:
> We can run the migration tests with two different QEMU binaries to
> test migration compatibility between QEMU versions. This means we'll
> be running the tests with an older QEMU in either source or
> destination.
>
> We need to avoid trying to test functionality that is unknown to the
> older QEMU. This could mean new features, bug fixes, error message
> changes, QEMU command line changes, migration API changes, etc.
>
> Add a 'since' argument to the tests that inform when the functionality
> that is being test has been added to QEMU so we can skip the test on
> older versions.
>
> Also add a version comparison function so we can adapt test code
> depending on the QEMU binary version being used.
>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
> tests/qtest/migration-helpers.c | 11 +++++++++++
> tests/qtest/migration-helpers.h | 1 +
> tests/qtest/migration-test.c | 28 ++++++++++++++++++++++++++++
> 3 files changed, 40 insertions(+)
>
> diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
> index 24fb7b3525..d21f5cd8c0 100644
> --- a/tests/qtest/migration-helpers.c
> +++ b/tests/qtest/migration-helpers.c
> @@ -292,3 +292,14 @@ char *resolve_machine_version(const char *alias, const char *var1,
>
> return find_common_machine_version(machine_name, var1, var2);
> }
> +
> +int migration_vercmp(QTestState *who, const char *tgt_version)
> +{
> + int major, minor, micro;
> + g_autofree char *version = NULL;
> +
> + qtest_query_version(who, &major, &minor, µ);
> + version = g_strdup_printf("%d.%d.%d", major, minor, micro);
I just noticed this is not right. I need to increment the minor when
there's a micro to account for the versions in between releases. The
whole point of this series is to test a X.Y.0 release vs. a X.Y.Z
development branch.
> +
> + return strcmp(version, tgt_version);
> +}
next prev parent reply other threads:[~2023-12-08 15:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 15:58 [PATCH v1 0/5] migration & CI: Add a CI job for migration compat testing Fabiano Rosas
2023-12-07 15:58 ` [PATCH v1 1/5] tests/qtest: Add a helper to query the QEMU version Fabiano Rosas
2023-12-19 14:32 ` Thomas Huth
2023-12-19 16:59 ` Fabiano Rosas
2023-12-07 15:58 ` [PATCH v1 2/5] tests/qtest/migration: Add infrastructure to skip tests on older QEMUs Fabiano Rosas
2023-12-08 15:02 ` Fabiano Rosas [this message]
2023-12-19 14:36 ` Thomas Huth
2023-12-19 17:02 ` Fabiano Rosas
2023-12-07 15:58 ` [PATCH v1 3/5] tests/qtest/migration: Adapt tests to use " Fabiano Rosas
2023-12-07 15:58 ` [PATCH v1 4/5] ci: Add a migration compatibility test job Fabiano Rosas
2023-12-07 15:58 ` [PATCH v1 5/5] [NOT FOR MERGE] compat hack until 8.2 is out Fabiano Rosas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zfykybyc.fsf@suse.de \
--to=farosas@suse.de \
--cc=berrange@redhat.com \
--cc=leobras@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.