From 617d7a600f4a76205d85c31670c0c3006dc70582 Mon Sep 17 00:00:00 2001 From: Lucas Mulling Date: Thu, 26 Dec 2024 13:40:33 -0300 Subject: [PATCH] Add option to disable explicit EC keys tests --- meson_options.txt | 5 +++++ tests/meson.build | 9 +++++++++ tests/setup.sh | 4 ++-- tests/tecxc | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 7e7b9bee..dba8627f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,3 +2,8 @@ option('preload_libasan', type: 'string', value: 'no', description: 'Path to libasan.so to preload') + +option('disable_explicit_EC_test', + type: 'boolean', + value: false, + description: 'Disable explicit EC tests') diff --git a/tests/meson.build b/tests/meson.build index abbdaa62..9dbc4da7 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -30,6 +30,10 @@ if nss_softokn.found() endif endif +if get_option('disable_explicit_EC_test') + conf_env.set('DISABLE_EXPLICIT_EC_TEST', '1') +endif + setup_script=find_program('setup.sh') foreach suite : ['softokn', 'softhsm', 'kryoptic', 'kryoptic.nss'] test( @@ -47,6 +51,10 @@ test_env = environment({ 'TESTBLDDIR': meson.current_build_dir(), }) +if get_option('disable_explicit_EC_test') + test_env.set('DISABLE_EXPLICIT_EC_TEST', '1') +endif + valgrind = find_program('valgrind', required: false) if valgrind.found() add_test_setup('valgrind', @@ -96,6 +104,7 @@ if get_option('b_sanitize') == 'address' endif endif + test_programs = { 'tsession': ['tsession.c'], 'tgenkey': ['tgenkey.c'], diff --git a/tests/setup.sh b/tests/setup.sh index 9cbd9292..db649eaa 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -305,8 +305,8 @@ echo "${ECPRI2URI}" echo "${ECCRT2URI}" echo "" -if [ -f /etc/redhat-release ]; then - title PARA "explicit EC unsupported on Fedora/EL" +if [ -n "${DISABLE_EXPLICIT_EC_TEST}" ]; then + title PARA "explicit EC unsupported" elif [ "${TOKENTYPE}" == "softokn" ]; then title PARA "explicit EC unsupported with softokn" else diff --git a/tests/tecxc b/tests/tecxc index f0b2e708..23d6ecae 100755 --- a/tests/tecxc +++ b/tests/tecxc @@ -4,7 +4,7 @@ # On Fedora/EL completely removed support for explicit EC from libcrypto, # so skip the test completely -if [ -f /etc/redhat-release ]; then +if [ -n "${DISABLE_EXPLICIT_EC_TEST}" ]; then exit 0 fi