From: Thomas Huth <thuth@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Jens Freimann <jfreimann@redhat.com>,
Juan Quintela <quintela@redhat.com>
Subject: Re: [PATCH v6 4/6] tests/libqtest: update virtio-net failover test
Date: Tue, 7 Dec 2021 09:33:52 +0100 [thread overview]
Message-ID: <99a0a6fb-f8c7-a882-f8cd-f7a56d4f2a30@redhat.com> (raw)
In-Reply-To: <20211206222040.3872253-5-lvivier@redhat.com>
On 06/12/2021 23.20, Laurent Vivier wrote:
> Update the migration test to check we correctly wait the end
> of the card unplug before doing the migration.
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> tests/qtest/virtio-net-failover.c | 34 +++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
>
> diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
> index f8f5fbb3c7fe..c88f8ddec39a 100644
> --- a/tests/qtest/virtio-net-failover.c
> +++ b/tests/qtest/virtio-net-failover.c
> @@ -560,6 +560,40 @@ static void test_migrate_out(gconstpointer opaque)
>
> qobject_unref(resp);
>
> + /* wait the end of the migration setup phase */
> + while (true) {
> + ret = migrate_status(qts);
> +
> + status = qdict_get_str(ret, "status");
> + if (strcmp(status, "wait-unplug") == 0) {
> + break;
> + }
> +
> + /* The migration must not start if the card is not ejected */
> + g_assert_cmpstr(status, !=, "active");
> + g_assert_cmpstr(status, !=, "completed");
> + g_assert_cmpstr(status, !=, "failed");
> + g_assert_cmpstr(status, !=, "cancelling");
> + g_assert_cmpstr(status, !=, "cancelled");
> +
> + qobject_unref(ret);
> + }
> + qobject_unref(ret);
> +
> + if (g_test_slow()) {
> + /* check we stay in wait-unplug while the card is not ejected */
> + int i;
> +
> + for (i = 0; i < 10; i++) {
10 seconds is quite long already, even for slow mode... I wouldn't expect
any difference after 2 or 3 seconds anymore anyway, so maybe just wait for 5
seconds?
> + sleep(1);
> + ret = migrate_status(qts);
> + status = qdict_get_str(ret, "status");
> + g_assert_cmpstr(status, ==, "wait-unplug");
> + qobject_unref(ret);
> + }
> + }
> +
> + /* OS unplugs the cards, QEMU can move from wait-unplug state */
> qtest_outl(qts, ACPI_PCIHP_ADDR_ICH9 + PCI_EJ_BASE, 1);
>
> while (true) {
>
Acked-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2021-12-07 8:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-06 22:20 [PATCH v6 0/6] tests/qtest: add some tests for virtio-net failover Laurent Vivier
2021-12-06 22:20 ` [PATCH v6 1/6] qtest/libqos: add a function to initialize secondary PCI buses Laurent Vivier
2021-12-07 8:09 ` Thomas Huth
2021-12-06 22:20 ` [PATCH v6 2/6] tests/qtest: add some tests for virtio-net failover Laurent Vivier
2021-12-07 8:29 ` Thomas Huth
2021-12-06 22:20 ` [PATCH v6 3/6] failover: fix unplug pending detection Laurent Vivier
2021-12-07 4:13 ` Ani Sinha
2021-12-07 7:31 ` Laurent Vivier
2021-12-06 22:20 ` [PATCH v6 4/6] tests/libqtest: update virtio-net failover test Laurent Vivier
2021-12-07 8:33 ` Thomas Huth [this message]
2021-12-06 22:20 ` [PATCH v6 5/6] test/libqtest: add some virtio-net failover migration cancelling tests Laurent Vivier
2021-12-07 8:35 ` Thomas Huth
2021-12-08 7:44 ` Michael S. Tsirkin
2021-12-08 7:48 ` Thomas Huth
2021-12-08 7:53 ` Thomas Huth
2021-12-06 22:20 ` [PATCH v6 6/6] tests/libqtest: add a migration test with two couples of failover devices Laurent Vivier
2021-12-07 8:39 ` Thomas Huth
2021-12-08 7:44 ` [PATCH v6 0/6] tests/qtest: add some tests for virtio-net failover Michael S. Tsirkin
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=99a0a6fb-f8c7-a882-f8cd-f7a56d4f2a30@redhat.com \
--to=thuth@redhat.com \
--cc=jfreimann@redhat.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).