]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: add a way to assume enabled groups in pqc-hybrid-kx.sh
authorDaiki Ueno <ueno@gnu.org>
Sat, 25 Jan 2025 08:58:01 +0000 (17:58 +0900)
committerDaiki Ueno <ueno@gnu.org>
Sat, 25 Jan 2025 11:30:53 +0000 (20:30 +0900)
With this patch, if TESTS_ENABLED_GROUPS is set, the listed groups
must be enabled and the pqc-hybrid-kx.sh test would fail.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
.gitlab-ci.yml
tests/pqc-hybrid-kx.sh

index 04799f0f7e575cf4c35c7edc2014134da5c31758..ec5256cd972f06d3466a0925ad726851c6141f53 100644 (file)
@@ -562,7 +562,7 @@ fedora-leancrypto/test:
   needs:
     - fedora-leancrypto/build
   script:
-    - PKG_CONFIG_PATH=${PWD}/leancrypto-git/$LEANCRYPTO_DIR/lib64/pkgconfig make -j$CHECKJOBS check
+    - PKG_CONFIG_PATH=${PWD}/leancrypto-git/$LEANCRYPTO_DIR/lib64/pkgconfig TESTS_ENABLED_GROUPS="GROUP-X25519-MLKEM768 GROUP-SECP256R1-MLKEM768 GROUP-SECP384R1-MLKEM1024" make -j$CHECKJOBS check
 
 fedora-threadsan/build:
   extends:
index f398d21bd3a5d1cdaac6ea17190444a1d8d0fab3..f67b07c45b8b1fd4dad6b4475e73e6cf5d1ea394 100644 (file)
@@ -63,8 +63,8 @@ else
         fail '' 'ML-KEM-1024 is NOT in Public Key Systems, while GROUP-SECP384R1-MLKEM1024 is in Groups'
     fi
 fi
-# If none of those hybrid groups is supported, skip the test
-if ! "${CLI}" --list | grep '^Groups: .*GROUP-\(X25519-KYBER768\|SECP256R1-MLKEM768\|SECP384R1-MLKEM1024\|X25519-MLKEM768\).*' >/dev/null; then
+# If none of those hybrid groups is supported, and TESTS_ENABLED_GROUPS is not set, skip the test
+if test "${TESTS_ENABLED_GROUPS+unset}" = unset && ! "${CLI}" --list | grep '^Groups: .*GROUP-\(X25519-KYBER768\|SECP256R1-MLKEM768\|SECP384R1-MLKEM1024\|X25519-MLKEM768\).*' >/dev/null; then
     exit 77
 fi
 
@@ -77,8 +77,15 @@ CACERT="$srcdir/../doc/credentials/x509/ca.pem"
 # Test all supported hybrid groups
 for group in X25519-KYBER768 SECP256R1-MLKEM768 SECP384R1-MLKEM1024 X25519-MLKEM768; do
     if ! "${CLI}" --list | grep "^Groups: .*GROUP-$group.*" >/dev/null; then
-       echo "$group is not supported, skipping" >&2
-       continue
+       case "$TESTS_ENABLED_GROUPS" in
+           *"$group"*)
+               fail '' "$group must be enabled"
+               ;;
+           *)
+               echo "$group is not supported nor enabled, skipping" >&2
+               continue
+               ;;
+       esac
     fi
 
     eval "${GETPORT}"