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 <lviv...@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