From 699459aa2322b8ba4cc364235f5a4f1d73d57978 Mon Sep 17 00:00:00 2001 From: Lucas Mulling Date: Fri, 27 Dec 2024 08:59:42 -0300 Subject: [PATCH] Make explicit EC tests off by default Signed-off-by: Lucas Mulling --- .github/workflows/build.yml | 6 +++++- meson_options.txt | 4 ++-- tests/meson.build | 8 ++++---- tests/setup.sh | 2 +- tests/tecxc | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6525b33d..e2cea12b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,7 +76,11 @@ jobs: git config --global --add safe.directory \ /__w/pkcs11-provider/pkcs11-provider git submodule update --init - CC=${{ matrix.compiler }} meson setup builddir + if [ -f /etc/fedora-release ]; then + CC=${{ matrix.compiler }} meson setup builddir + else + CC=${{ matrix.compiler }} meson setup builddir -Denable_explicit_EC_test=true + fi - name: Build and Test if : ( steps.nss-version-check.outputs.skiptest != 'true' ) run: | diff --git a/meson_options.txt b/meson_options.txt index dba8627f..20ce4bdf 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,7 +3,7 @@ option('preload_libasan', value: 'no', description: 'Path to libasan.so to preload') -option('disable_explicit_EC_test', +option('enable_explicit_EC_test', type: 'boolean', value: false, - description: 'Disable explicit EC tests') + description: 'Enable explicit EC tests') diff --git a/tests/meson.build b/tests/meson.build index 9dbc4da7..52280dbc 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -30,8 +30,8 @@ if nss_softokn.found() endif endif -if get_option('disable_explicit_EC_test') - conf_env.set('DISABLE_EXPLICIT_EC_TEST', '1') +if get_option('enable_explicit_EC_test') + conf_env.set('ENABLE_EXPLICIT_EC_TEST', '1') endif setup_script=find_program('setup.sh') @@ -51,8 +51,8 @@ test_env = environment({ 'TESTBLDDIR': meson.current_build_dir(), }) -if get_option('disable_explicit_EC_test') - test_env.set('DISABLE_EXPLICIT_EC_TEST', '1') +if get_option('enable_explicit_EC_test') + test_env.set('ENABLE_EXPLICIT_EC_TEST', '1') endif valgrind = find_program('valgrind', required: false) diff --git a/tests/setup.sh b/tests/setup.sh index db649eaa..8812347c 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -305,7 +305,7 @@ echo "${ECPRI2URI}" echo "${ECCRT2URI}" echo "" -if [ -n "${DISABLE_EXPLICIT_EC_TEST}" ]; then +if [ -z "${ENABLE_EXPLICIT_EC_TEST}" ]; then title PARA "explicit EC unsupported" elif [ "${TOKENTYPE}" == "softokn" ]; then title PARA "explicit EC unsupported with softokn" diff --git a/tests/tecxc b/tests/tecxc index b2952f6e..9dc3240a 100755 --- a/tests/tecxc +++ b/tests/tecxc @@ -3,8 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 # Some distributions completely removed support for explicit EC from libcrypto. -# If `-Ddisable_explicit_EC_test=true` is set, skip the test. -if [ -n "${DISABLE_EXPLICIT_EC_TEST}" ]; then +# If `-Denable_explicit_EC_test=true` is not set, skip the test. +if [ -z "${ENABLE_EXPLICIT_EC_TEST}" ]; then exit 0 fi