All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Laurent Vivier" <lvivier@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Juan Quintela" <quintela@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Ani Sinha" <ani@anisinha.ca>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Jens Freimann" <jfreimann@redhat.com>
Subject: [PATCH v5 4/4] tests/libqtest: update virtio-net failover test
Date: Fri, 19 Nov 2021 10:07:18 +0100	[thread overview]
Message-ID: <20211119090718.440793-5-lvivier@redhat.com> (raw)
In-Reply-To: <20211119090718.440793-1-lvivier@redhat.com>

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 | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c
index 11fa0b21f8bf..9a81133154d6 100644
--- a/tests/qtest/virtio-net-failover.c
+++ b/tests/qtest/virtio-net-failover.c
@@ -541,6 +541,29 @@ static void test_outmigrate(gconstpointer opaque)
 
     qobject_unref(resp);
 
+    /* wait the end of the migration setup phase */
+    while (true) {
+        const gchar *status;
+
+        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);
+
+    /* OS unplugs the cards, QEMU can move from wait-unplug state */
     qtest_outl(qts, ACPI_PCIHP_ADDR_ICH9 + PCI_EJ_BASE, 1);
 
     qtest_qmp_eventwait(qts, "STOP");
-- 
2.33.1



  parent reply	other threads:[~2021-11-19  9:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19  9:07 [PATCH v5 0/4] tests/qtest: add some tests for virtio-net failover Laurent Vivier
2021-11-19  9:07 ` [PATCH v5 1/4] qtest/libqos: add a function to initialize secondary PCI buses Laurent Vivier
2021-11-19  9:07 ` [PATCH v5 2/4] tests/qtest: add some tests for virtio-net failover Laurent Vivier
2021-11-19  9:07 ` [PATCH v5 3/4] failover: fix unplug pending detection Laurent Vivier
2021-12-08  7:36   ` Michael S. Tsirkin
2021-12-08  7:50     ` Thomas Huth
2021-12-08 10:44       ` Ani Sinha
2021-12-08 11:11       ` Michael S. Tsirkin
2021-11-19  9:07 ` Laurent Vivier [this message]
2021-12-08  7:34 ` [PATCH v5 0/4] 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=20211119090718.440793-5-lvivier@redhat.com \
    --to=lvivier@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=berrange@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jfreimann@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --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.