aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/virtio-net-failover.c
AgeCommit message (Collapse)Author
2022-09-27tests/qtest: virtio-net-failover: Disable migration tests for win32Xuzhou Cheng
These tests use the exec migration protocol, which is unsupported on Windows as of today. Disable these tests for now. Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com> Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-42-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-05-03tests: move libqtest.h back under qtest/Marc-André Lureau
Since commit a2ce7dbd917 ("meson: convert tests/qtest to meson"), libqtest.h is under libqos/ directory, while libqtest.c is still in qtest/. Move back to its original location to avoid mixing with libqos/. Suggested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2022-03-29tests/qtest: failover: fix infinite loopLaurent Vivier
If the migration is over before we cancel it, we are waiting in a loop a state that never comes because the state is already "completed". To avoid an infinite loop, skip the test if the migration is "completed" before we were able to cancel it. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-id: 20220329124259.355995-1-lvivier@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-02-21tests/qtest: failover: migration abort test with failover offLaurent Vivier
Test abort during active migration when failover is disabled from QEMU or from guest side. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20220203141537.972317-8-lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-02-21tests/qtest: failover: test migration if the guest doesn't support failoverLaurent Vivier
The primary device is not plugged and the migration is done only with the standby device Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20220203141537.972317-7-lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-02-21tests/qtest: failover: check migration with failover offLaurent Vivier
If failover is off, the primary device is not plugged and the migration is done only with the standby device. On destination, the primary device must not be plugged. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20220203141537.972317-6-lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-02-21tests/qtest: failover: check missing guest featureLaurent Vivier
If QEMU provides the VIRTIO_NET_F_STANDBY feature but the guest doesn't the primary device must be kept hidden Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20220203141537.972317-5-lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-02-21tests/qtest: failover: check the feature is correctly providedLaurent Vivier
Check QEMU provides the VIRTIO_NET_F_STANDBY if failover is on, and doesn't if failover is off Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20220203141537.972317-4-lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-02-21tests/qtest: failover: use a macro for check_one_card()Laurent Vivier
This allows g_assert() to correctly report the line number of the error in the test case. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20220203141537.972317-3-lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-02-21tests/qtest: failover: clean up pathname of testsLaurent Vivier
clearly indentify parameters, hotplug and migration tests Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20220203141537.972317-2-lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-12-22tests/qtest/virtio-net-failover: Use g_file_open_tmp() to create temporary fileThomas Huth
g_test_rand_int() must not be called before g_test_init(), otherwise the glib will show a "g_rand_int: assertion 'rand != NULL' failed" message in the log. So we could change the order here, but actually, it's safer to use g_file_open_tmp() anyway, so let's use that function now instead. Reported-by: Philippe Mathieu-Daudé <philmd@redhat.com> Suggested-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20211222083652.776592-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-12-15tests/libqtest: add a migration test with two couples of failover devicesLaurent Vivier
Signed-off-by: Laurent Vivier <lvivier@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-Id: <20211208130350.10178-5-lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-12-15tests/libqtest: add some virtio-net failover migration cancelling testsLaurent Vivier
Add some tests to check the state of the machine if the migration is cancelled while we are using virtio-net failover. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Message-Id: <20211208130350.10178-4-lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-12-15tests/qtest: add some tests for virtio-net failoverLaurent Vivier
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> Message-Id: <20211208130350.10178-3-lvivier@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>