summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2025-05-07 15:48:31 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2025-05-21 19:36:43 +0100
commit01ce649e5d260d4d1a466d10dfaeabeeb2b7478d (patch)
tree782118a2e7cbd0d328542273ea2eb07238d7e7de
parent75134a32851e2d9f240097cc7a3bc3426667e147 (diff)
downloadfocaccia-qemu-01ce649e5d260d4d1a466d10dfaeabeeb2b7478d.tar.gz
focaccia-qemu-01ce649e5d260d4d1a466d10dfaeabeeb2b7478d.zip
tests: fix skipping cipher tests when AES is not available
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>
-rw-r--r--tests/unit/test-crypto-cipher.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/unit/test-crypto-cipher.c b/tests/unit/test-crypto-cipher.c
index b328b482e1..1331d558cf 100644
--- a/tests/unit/test-crypto-cipher.c
+++ b/tests/unit/test-crypto-cipher.c
@@ -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();
 }