[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 4/4] tests/libqtest: update virtio-net failover test
From: |
Laurent Vivier |
Subject: |
[PATCH v5 4/4] tests/libqtest: update virtio-net failover test |
Date: |
Fri, 19 Nov 2021 10:07:18 +0100 |
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