qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 2/4] tests/qtest: add some tests for virtio-net failover


From: Thomas Huth
Subject: Re: [PATCH v7 2/4] tests/qtest: add some tests for virtio-net failover
Date: Wed, 8 Dec 2021 09:39:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

On 07/12/2021 18.23, Laurent Vivier wrote:
Add test cases to test several error cases that must be
generated by invalid failover configuration.

Add a combination of coldplug and hotplug test cases to be
sure the primary is correctly managed according the
presence or not of the STANDBY feature.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
[...]
diff --git a/tests/qtest/virtio-net-failover.c 
b/tests/qtest/virtio-net-failover.c
new file mode 100644
index 000000000000..7444d30d2900
--- /dev/null
+++ b/tests/qtest/virtio-net-failover.c
[...]
+static char *get_mac(QTestState *qts, const char *name)
+{
+    QDict *resp;
+    char *mac;
+
+    resp = qtest_qmp(qts, "{ 'execute': 'qom-get', "
+                     "'arguments': { "
+                     "'path': %s, "
+                     "'property': 'mac' } }", name);
+
+    g_assert(qdict_haskey(resp, "return"));
+
+    mac = g_strdup( qdict_get_str(resp, "return"));

FYI, check_patch.pl complains about the space after the "(" here.

I'll fix it up locally, no need to resend just because of this.

+    qobject_unref(resp);
+
+    return mac;
+}

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]