tests/qtest/migration: Use the new migration_test_add

Replace the tests registration with the new function that prints tests
names.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/20240104142144.9680-8-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
Fabiano Rosas 2024-01-04 11:21:44 -03:00 committed by Peter Xu
parent e33b6712db
commit 6f0771de90

View file

@ -3404,70 +3404,75 @@ int main(int argc, char **argv)
module_call_init(MODULE_INIT_QOM); module_call_init(MODULE_INIT_QOM);
if (is_x86) { if (is_x86) {
qtest_add_func("/migration/precopy/unix/suspend/live", migration_test_add("/migration/precopy/unix/suspend/live",
test_precopy_unix_suspend_live); test_precopy_unix_suspend_live);
qtest_add_func("/migration/precopy/unix/suspend/notlive", migration_test_add("/migration/precopy/unix/suspend/notlive",
test_precopy_unix_suspend_notlive); test_precopy_unix_suspend_notlive);
} }
if (has_uffd) { if (has_uffd) {
qtest_add_func("/migration/postcopy/plain", test_postcopy); migration_test_add("/migration/postcopy/plain", test_postcopy);
qtest_add_func("/migration/postcopy/recovery/plain", migration_test_add("/migration/postcopy/recovery/plain",
test_postcopy_recovery); test_postcopy_recovery);
qtest_add_func("/migration/postcopy/preempt/plain", test_postcopy_preempt); migration_test_add("/migration/postcopy/preempt/plain",
qtest_add_func("/migration/postcopy/preempt/recovery/plain", test_postcopy_preempt);
test_postcopy_preempt_recovery); migration_test_add("/migration/postcopy/preempt/recovery/plain",
test_postcopy_preempt_recovery);
if (getenv("QEMU_TEST_FLAKY_TESTS")) { if (getenv("QEMU_TEST_FLAKY_TESTS")) {
qtest_add_func("/migration/postcopy/compress/plain", migration_test_add("/migration/postcopy/compress/plain",
test_postcopy_compress); test_postcopy_compress);
qtest_add_func("/migration/postcopy/recovery/compress/plain", migration_test_add("/migration/postcopy/recovery/compress/plain",
test_postcopy_recovery_compress); test_postcopy_recovery_compress);
} }
#ifndef _WIN32 #ifndef _WIN32
qtest_add_func("/migration/postcopy/recovery/double-failures", migration_test_add("/migration/postcopy/recovery/double-failures",
test_postcopy_recovery_double_fail); test_postcopy_recovery_double_fail);
#endif /* _WIN32 */ #endif /* _WIN32 */
if (is_x86) { if (is_x86) {
qtest_add_func("/migration/postcopy/suspend", migration_test_add("/migration/postcopy/suspend",
test_postcopy_suspend); test_postcopy_suspend);
} }
} }
qtest_add_func("/migration/bad_dest", test_baddest); migration_test_add("/migration/bad_dest", test_baddest);
#ifndef _WIN32 #ifndef _WIN32
qtest_add_func("/migration/analyze-script", test_analyze_script); if (!g_str_equal(arch, "s390x")) {
migration_test_add("/migration/analyze-script", test_analyze_script);
}
#endif #endif
qtest_add_func("/migration/precopy/unix/plain", test_precopy_unix_plain); migration_test_add("/migration/precopy/unix/plain",
qtest_add_func("/migration/precopy/unix/xbzrle", test_precopy_unix_xbzrle); test_precopy_unix_plain);
migration_test_add("/migration/precopy/unix/xbzrle",
test_precopy_unix_xbzrle);
/* /*
* Compression fails from time to time. * Compression fails from time to time.
* Put test here but don't enable it until everything is fixed. * Put test here but don't enable it until everything is fixed.
*/ */
if (getenv("QEMU_TEST_FLAKY_TESTS")) { if (getenv("QEMU_TEST_FLAKY_TESTS")) {
qtest_add_func("/migration/precopy/unix/compress/wait", migration_test_add("/migration/precopy/unix/compress/wait",
test_precopy_unix_compress); test_precopy_unix_compress);
qtest_add_func("/migration/precopy/unix/compress/nowait", migration_test_add("/migration/precopy/unix/compress/nowait",
test_precopy_unix_compress_nowait); test_precopy_unix_compress_nowait);
} }
qtest_add_func("/migration/precopy/file", migration_test_add("/migration/precopy/file",
test_precopy_file); test_precopy_file);
qtest_add_func("/migration/precopy/file/offset", migration_test_add("/migration/precopy/file/offset",
test_precopy_file_offset); test_precopy_file_offset);
qtest_add_func("/migration/precopy/file/offset/bad", migration_test_add("/migration/precopy/file/offset/bad",
test_precopy_file_offset_bad); test_precopy_file_offset_bad);
/* /*
* Our CI system has problems with shared memory. * Our CI system has problems with shared memory.
* Don't run this test until we find a workaround. * Don't run this test until we find a workaround.
*/ */
if (getenv("QEMU_TEST_FLAKY_TESTS")) { if (getenv("QEMU_TEST_FLAKY_TESTS")) {
qtest_add_func("/migration/mode/reboot", test_mode_reboot); migration_test_add("/migration/mode/reboot", test_mode_reboot);
} }
#ifdef CONFIG_GNUTLS #ifdef CONFIG_GNUTLS
qtest_add_func("/migration/precopy/unix/tls/psk", migration_test_add("/migration/precopy/unix/tls/psk",
test_precopy_unix_tls_psk); test_precopy_unix_tls_psk);
if (has_uffd) { if (has_uffd) {
/* /*
@ -3475,110 +3480,114 @@ int main(int argc, char **argv)
* channels are tested under precopy. Here what we want to test is the * channels are tested under precopy. Here what we want to test is the
* general postcopy path that has TLS channel enabled. * general postcopy path that has TLS channel enabled.
*/ */
qtest_add_func("/migration/postcopy/tls/psk", test_postcopy_tls_psk); migration_test_add("/migration/postcopy/tls/psk",
qtest_add_func("/migration/postcopy/recovery/tls/psk", test_postcopy_tls_psk);
test_postcopy_recovery_tls_psk); migration_test_add("/migration/postcopy/recovery/tls/psk",
qtest_add_func("/migration/postcopy/preempt/tls/psk", test_postcopy_recovery_tls_psk);
test_postcopy_preempt_tls_psk); migration_test_add("/migration/postcopy/preempt/tls/psk",
qtest_add_func("/migration/postcopy/preempt/recovery/tls/psk", test_postcopy_preempt_tls_psk);
test_postcopy_preempt_all); migration_test_add("/migration/postcopy/preempt/recovery/tls/psk",
test_postcopy_preempt_all);
} }
#ifdef CONFIG_TASN1 #ifdef CONFIG_TASN1
qtest_add_func("/migration/precopy/unix/tls/x509/default-host", migration_test_add("/migration/precopy/unix/tls/x509/default-host",
test_precopy_unix_tls_x509_default_host); test_precopy_unix_tls_x509_default_host);
qtest_add_func("/migration/precopy/unix/tls/x509/override-host", migration_test_add("/migration/precopy/unix/tls/x509/override-host",
test_precopy_unix_tls_x509_override_host); test_precopy_unix_tls_x509_override_host);
#endif /* CONFIG_TASN1 */ #endif /* CONFIG_TASN1 */
#endif /* CONFIG_GNUTLS */ #endif /* CONFIG_GNUTLS */
qtest_add_func("/migration/precopy/tcp/plain", test_precopy_tcp_plain); migration_test_add("/migration/precopy/tcp/plain", test_precopy_tcp_plain);
qtest_add_func("/migration/precopy/tcp/plain/switchover-ack", migration_test_add("/migration/precopy/tcp/plain/switchover-ack",
test_precopy_tcp_switchover_ack); test_precopy_tcp_switchover_ack);
#ifdef CONFIG_GNUTLS #ifdef CONFIG_GNUTLS
qtest_add_func("/migration/precopy/tcp/tls/psk/match", migration_test_add("/migration/precopy/tcp/tls/psk/match",
test_precopy_tcp_tls_psk_match); test_precopy_tcp_tls_psk_match);
qtest_add_func("/migration/precopy/tcp/tls/psk/mismatch", migration_test_add("/migration/precopy/tcp/tls/psk/mismatch",
test_precopy_tcp_tls_psk_mismatch); test_precopy_tcp_tls_psk_mismatch);
#ifdef CONFIG_TASN1 #ifdef CONFIG_TASN1
qtest_add_func("/migration/precopy/tcp/tls/x509/default-host", migration_test_add("/migration/precopy/tcp/tls/x509/default-host",
test_precopy_tcp_tls_x509_default_host); test_precopy_tcp_tls_x509_default_host);
qtest_add_func("/migration/precopy/tcp/tls/x509/override-host", migration_test_add("/migration/precopy/tcp/tls/x509/override-host",
test_precopy_tcp_tls_x509_override_host); test_precopy_tcp_tls_x509_override_host);
qtest_add_func("/migration/precopy/tcp/tls/x509/mismatch-host", migration_test_add("/migration/precopy/tcp/tls/x509/mismatch-host",
test_precopy_tcp_tls_x509_mismatch_host); test_precopy_tcp_tls_x509_mismatch_host);
qtest_add_func("/migration/precopy/tcp/tls/x509/friendly-client", migration_test_add("/migration/precopy/tcp/tls/x509/friendly-client",
test_precopy_tcp_tls_x509_friendly_client); test_precopy_tcp_tls_x509_friendly_client);
qtest_add_func("/migration/precopy/tcp/tls/x509/hostile-client", migration_test_add("/migration/precopy/tcp/tls/x509/hostile-client",
test_precopy_tcp_tls_x509_hostile_client); test_precopy_tcp_tls_x509_hostile_client);
qtest_add_func("/migration/precopy/tcp/tls/x509/allow-anon-client", migration_test_add("/migration/precopy/tcp/tls/x509/allow-anon-client",
test_precopy_tcp_tls_x509_allow_anon_client); test_precopy_tcp_tls_x509_allow_anon_client);
qtest_add_func("/migration/precopy/tcp/tls/x509/reject-anon-client", migration_test_add("/migration/precopy/tcp/tls/x509/reject-anon-client",
test_precopy_tcp_tls_x509_reject_anon_client); test_precopy_tcp_tls_x509_reject_anon_client);
#endif /* CONFIG_TASN1 */ #endif /* CONFIG_TASN1 */
#endif /* CONFIG_GNUTLS */ #endif /* CONFIG_GNUTLS */
/* qtest_add_func("/migration/ignore_shared", test_ignore_shared); */ /* migration_test_add("/migration/ignore_shared", test_ignore_shared); */
#ifndef _WIN32 #ifndef _WIN32
qtest_add_func("/migration/fd_proto", test_migrate_fd_proto); migration_test_add("/migration/fd_proto", test_migrate_fd_proto);
#endif #endif
qtest_add_func("/migration/validate_uuid", test_validate_uuid); migration_test_add("/migration/validate_uuid", test_validate_uuid);
qtest_add_func("/migration/validate_uuid_error", test_validate_uuid_error); migration_test_add("/migration/validate_uuid_error",
qtest_add_func("/migration/validate_uuid_src_not_set", test_validate_uuid_error);
test_validate_uuid_src_not_set); migration_test_add("/migration/validate_uuid_src_not_set",
qtest_add_func("/migration/validate_uuid_dst_not_set", test_validate_uuid_src_not_set);
test_validate_uuid_dst_not_set); migration_test_add("/migration/validate_uuid_dst_not_set",
test_validate_uuid_dst_not_set);
/* /*
* See explanation why this test is slow on function definition * See explanation why this test is slow on function definition
*/ */
if (g_test_slow()) { if (g_test_slow()) {
qtest_add_func("/migration/auto_converge", test_migrate_auto_converge); migration_test_add("/migration/auto_converge",
test_migrate_auto_converge);
if (g_str_equal(arch, "x86_64") && if (g_str_equal(arch, "x86_64") &&
has_kvm && kvm_dirty_ring_supported()) { has_kvm && kvm_dirty_ring_supported()) {
qtest_add_func("/migration/dirty_limit", test_migrate_dirty_limit); migration_test_add("/migration/dirty_limit",
test_migrate_dirty_limit);
} }
} }
qtest_add_func("/migration/multifd/tcp/plain/none", migration_test_add("/migration/multifd/tcp/plain/none",
test_multifd_tcp_none); test_multifd_tcp_none);
/* /*
* This test is flaky and sometimes fails in CI and otherwise: * This test is flaky and sometimes fails in CI and otherwise:
* don't run unless user opts in via environment variable. * don't run unless user opts in via environment variable.
*/ */
if (getenv("QEMU_TEST_FLAKY_TESTS")) { if (getenv("QEMU_TEST_FLAKY_TESTS")) {
qtest_add_func("/migration/multifd/tcp/plain/cancel", migration_test_add("/migration/multifd/tcp/plain/cancel",
test_multifd_tcp_cancel); test_multifd_tcp_cancel);
} }
qtest_add_func("/migration/multifd/tcp/plain/zlib", migration_test_add("/migration/multifd/tcp/plain/zlib",
test_multifd_tcp_zlib); test_multifd_tcp_zlib);
#ifdef CONFIG_ZSTD #ifdef CONFIG_ZSTD
qtest_add_func("/migration/multifd/tcp/plain/zstd", migration_test_add("/migration/multifd/tcp/plain/zstd",
test_multifd_tcp_zstd); test_multifd_tcp_zstd);
#endif #endif
#ifdef CONFIG_GNUTLS #ifdef CONFIG_GNUTLS
qtest_add_func("/migration/multifd/tcp/tls/psk/match", migration_test_add("/migration/multifd/tcp/tls/psk/match",
test_multifd_tcp_tls_psk_match); test_multifd_tcp_tls_psk_match);
qtest_add_func("/migration/multifd/tcp/tls/psk/mismatch", migration_test_add("/migration/multifd/tcp/tls/psk/mismatch",
test_multifd_tcp_tls_psk_mismatch); test_multifd_tcp_tls_psk_mismatch);
#ifdef CONFIG_TASN1 #ifdef CONFIG_TASN1
qtest_add_func("/migration/multifd/tcp/tls/x509/default-host", migration_test_add("/migration/multifd/tcp/tls/x509/default-host",
test_multifd_tcp_tls_x509_default_host); test_multifd_tcp_tls_x509_default_host);
qtest_add_func("/migration/multifd/tcp/tls/x509/override-host", migration_test_add("/migration/multifd/tcp/tls/x509/override-host",
test_multifd_tcp_tls_x509_override_host); test_multifd_tcp_tls_x509_override_host);
qtest_add_func("/migration/multifd/tcp/tls/x509/mismatch-host", migration_test_add("/migration/multifd/tcp/tls/x509/mismatch-host",
test_multifd_tcp_tls_x509_mismatch_host); test_multifd_tcp_tls_x509_mismatch_host);
qtest_add_func("/migration/multifd/tcp/tls/x509/allow-anon-client", migration_test_add("/migration/multifd/tcp/tls/x509/allow-anon-client",
test_multifd_tcp_tls_x509_allow_anon_client); test_multifd_tcp_tls_x509_allow_anon_client);
qtest_add_func("/migration/multifd/tcp/tls/x509/reject-anon-client", migration_test_add("/migration/multifd/tcp/tls/x509/reject-anon-client",
test_multifd_tcp_tls_x509_reject_anon_client); test_multifd_tcp_tls_x509_reject_anon_client);
#endif /* CONFIG_TASN1 */ #endif /* CONFIG_TASN1 */
#endif /* CONFIG_GNUTLS */ #endif /* CONFIG_GNUTLS */
if (g_str_equal(arch, "x86_64") && has_kvm && kvm_dirty_ring_supported()) { if (g_str_equal(arch, "x86_64") && has_kvm && kvm_dirty_ring_supported()) {
qtest_add_func("/migration/dirty_ring", migration_test_add("/migration/dirty_ring",
test_precopy_unix_dirty_ring); test_precopy_unix_dirty_ring);
qtest_add_func("/migration/vcpu_dirty_limit", migration_test_add("/migration/vcpu_dirty_limit",
test_vcpu_dirty_limit); test_vcpu_dirty_limit);
} }
ret = g_test_run(); ret = g_test_run();