@samitouri / QOSamiQemu / commits / bdfe26faca

tests/qtest/migration: Only build tls_no_hostname test with TASN1

The test_precopy_tcp_tls_no_hostname test and its start hook use TestMigrateTLSX509 and migrate_hook_start_tls_x509_common(), which are only defined when CONFIG_TASN1 is set. This means building with gnutls enabled but libtasn1 unavailable fails: ../tests/qtest/migration/tls-tests.c: In function 'migrate_hook_start_tls_x509_no_host': ../tests/qtest/migration/tls-tests.c:510:5: error: unknown type name 'TestMigrateTLSX509' Guard the test with CONFIG_TASN1 like the other x509 tests. Fixes: df9c38b19af8 ("tests/qtest/migration: Add a NULL parameters test for TLS") Signed-off-by: Sam Heney <github@me.samiser.xyz> Link: https://lore.kernel.org/r/5f24de0e-49af-45a7-927f-f79b203bb335@app.fastmail.com Signed-off-by: Peter Xu <peterx@redhat.com>

Sam Heney committed Jul 30, 2026 at 23:59 UTC bdfe26faca7b7c8daa7895783d55ec6d05164880
1 file changed +3 -1
tests/qtest/migration/tls-tests.c
+3 -1
@@ -492,6 +492,7 @@ static void test_precopy_tcp_no_tls(char *name, MigrateCommon *args)
492 test_precopy_common(args);
493 }
494
495 +#ifdef CONFIG_TASN1
496 static void *
497 migrate_hook_start_tls_x509_no_host(QTestState *from, QTestState *to)
498 {
@@ -519,7 +520,6 @@ static void test_precopy_tcp_tls_no_hostname(char *name, MigrateCommon *args)
520 test_precopy_common(args);
521 }
522
522 -#ifdef CONFIG_TASN1
523 static void test_precopy_tcp_tls_x509_default_host(char *name,
524 MigrateCommon *args)
525 {
@@ -719,8 +719,10 @@ void migration_test_add_tls(MigrationTestEnv *env)
719
720 migration_test_add("/migration/precopy/tcp/no-tls",
721 test_precopy_tcp_no_tls);
722 +#ifdef CONFIG_TASN1
723 migration_test_add("/migration/precopy/tcp/tls/no-hostname",
724 test_precopy_tcp_tls_no_hostname);
725 +#endif /* CONFIG_TASN1 */
726
727 migration_test_add("/migration/precopy/unix/tls/psk",
728 test_precopy_unix_tls_psk);