Commit Graph

11 Commits

Author SHA1 Message Date
Laurent Vivier e20977b797 tests/qtest: failover: migration abort test with failover off
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-21 10:15:55 +01:00
Laurent Vivier d9872c00f7 tests/qtest: failover: test migration if the guest doesn't support failover
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-21 10:15:55 +01:00
Laurent Vivier 7f998491ae tests/qtest: failover: check migration with failover off
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-21 10:15:55 +01:00
Laurent Vivier 78475083f7 tests/qtest: failover: check missing guest feature
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-21 10:15:55 +01:00
Laurent Vivier 93262464d2 tests/qtest: failover: check the feature is correctly provided
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-21 10:15:55 +01:00
Laurent Vivier 1a800870c5 tests/qtest: failover: use a macro for check_one_card()
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-21 10:15:55 +01:00
Laurent Vivier fbd2913cce tests/qtest: failover: clean up pathname of tests
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>
2022-02-21 10:15:55 +01:00
Thomas Huth e63ed64c6d tests/qtest/virtio-net-failover: Use g_file_open_tmp() to create temporary file
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-22 09:37:14 +01:00
Laurent Vivier e1e3d32118 tests/libqtest: add a migration test with two couples of failover devices
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-15 08:08:59 +01:00
Laurent Vivier 1e2077e223 tests/libqtest: add some virtio-net failover migration cancelling tests
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-15 08:08:51 +01:00
Laurent Vivier e32b96b559 tests/qtest: add some tests for virtio-net failover
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>
2021-12-15 08:07:04 +01:00