]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests: fix skipping cipher tests when AES is not available
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 7 May 2025 14:48:31 +0000 (15:48 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 21 May 2025 18:36:43 +0000 (19:36 +0100)
This avoid tests breakage when we drop support for using the
built-in AES impl as a fallback for missing crypto libraries.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tests/unit/test-crypto-cipher.c

index b328b482e16f36983b6e3837116ffe0fdf7ea348..1331d558cf2517d18bb6df5262e351704f10edf3 100644 (file)
@@ -828,11 +828,16 @@ int main(int argc, char **argv)
         }
     }
 
-    g_test_add_func("/crypto/cipher/null-iv",
-                    test_cipher_null_iv);
+    if (qcrypto_cipher_supports(QCRYPTO_CIPHER_ALGO_AES_256,
+                                QCRYPTO_CIPHER_MODE_CBC)) {
+        g_test_add_func("/crypto/cipher/null-iv",
+                        test_cipher_null_iv);
 
-    g_test_add_func("/crypto/cipher/short-plaintext",
-                    test_cipher_short_plaintext);
+        g_test_add_func("/crypto/cipher/short-plaintext",
+                        test_cipher_short_plaintext);
+    } else {
+        g_printerr("# skip unsupported aes-256:cbc\n");
+    }
 
     return g_test_run();
 }