From 221e1bc2a360cdbc935ca8e57616556380b2aa92 Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Thu, 11 Nov 2021 09:35:46 +0100 Subject: [PATCH] Update .gitlab-ci.yml with openssl setup GitLab CI needs to know about some environment variables that will tell where OpenSSL and SoftHSM2 is installed. This is done in the image, making the prepare-softhsm2.sh script obsolete. The SoftHSM2 module location is system specific. --- .gitlab-ci.yml | 15 ++++++++------- bin/tests/Makefile.am | 2 -- bin/tests/prepare-softhsm2.sh | 22 ---------------------- 3 files changed, 8 insertions(+), 31 deletions(-) delete mode 100755 bin/tests/prepare-softhsm2.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ebad9ab73..043968b93f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,9 @@ variables: CI_REGISTRY_IMAGE: registry.gitlab.isc.org/isc-projects/images/bind9 CCACHE_DIR: "/ccache" SOFTHSM2_CONF: "/var/tmp/softhsm2/softhsm2.conf" + OPENSSL_ENGINES: "/usr/lib/x86_64-linux-gnu/engines-1.1" + DEFAULT_OPENSSL_CONF: "/etc/ssl/openssl.cnf" + OPENSSL_CONF: "/var/tmp/etc/openssl.cnf" GIT_DEPTH: 1 BUILD_PARALLEL_JOBS: 6 @@ -309,15 +312,10 @@ stages: sudo sh -x bin/tests/system/ifconfig.sh up; fi -.setup_softhsm: &setup_softhsm - - export SLOT=$(sh -x bin/tests/prepare-softhsm2.sh) - - test -n "${SLOT}" && test "${SLOT}" -gt 0 - .system_test_common: &system_test_common <<: *default_triggering_rules stage: system before_script: - - *setup_softhsm - *retrieve_out_of_tree_workspace - *setup_interfaces script: @@ -358,7 +356,6 @@ stages: <<: *default_triggering_rules stage: unit before_script: - - *setup_softhsm - *retrieve_out_of_tree_workspace script: - make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1 @@ -932,11 +929,14 @@ gcc:asan: CC: gcc CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined" LDFLAGS: "-fsanitize=address,undefined" + SOFTHSM2_MODULE: "/lib64/libsofthsm2.so" EXTRA_CONFIGURE: "--with-libidn2 --without-jemalloc" <<: *fedora_35_amd64_image <<: *build_job system:gcc:asan: + variables: + SOFTHSM2_MODULE: "/lib64/libsofthsm2.so" <<: *fedora_35_amd64_image <<: *system_test_job needs: @@ -980,12 +980,14 @@ gcc:tsan: CC: gcc CFLAGS: "${CFLAGS_COMMON} -fsanitize=thread" LDFLAGS: "-fsanitize=thread" + SOFTHSM2_MODULE: "/lib64/libsofthsm2.so" EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock --without-jemalloc" <<: *fedora_35_amd64_image <<: *build_job system:gcc:tsan: variables: + SOFTHSM2_MODULE: "/lib64/libsofthsm2.so" TSAN_OPTIONS: ${TSAN_OPTIONS_COMMON} <<: *fedora_35_amd64_image <<: *system_test_tsan_job @@ -1297,7 +1299,6 @@ respdiff-third-party: script: - *configure - *setup_interfaces - - *setup_softhsm - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1 - make DESTDIR="${INSTALL_PATH}" install - git clone --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.isc.org/isc-private/bind-qa.git diff --git a/bin/tests/Makefile.am b/bin/tests/Makefile.am index 5366cc4496..7c2ebe27d5 100644 --- a/bin/tests/Makefile.am +++ b/bin/tests/Makefile.am @@ -31,5 +31,3 @@ wire_test_CPPFLAGS = \ wire_test_LDADD = \ $(LIBISC_LIBS) \ $(LIBDNS_LIBS) - -EXTRA_DIST = prepare-softhsm2.sh diff --git a/bin/tests/prepare-softhsm2.sh b/bin/tests/prepare-softhsm2.sh deleted file mode 100755 index f1fa19433d..0000000000 --- a/bin/tests/prepare-softhsm2.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# Copyright (C) Internet Systems Consortium, Inc. ("ISC") -# -# SPDX-License-Identifier: MPL-2.0 -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, you can obtain one at https://mozilla.org/MPL/2.0/. -# -# See the COPYRIGHT file distributed with this work for additional -# information regarding copyright ownership. - -if [ -n "${SOFTHSM2_CONF}" ] && command -v softhsm2-util >/dev/null; then - SOFTHSM2_DIR=$(dirname "$SOFTHSM2_CONF") - mkdir -p "${SOFTHSM2_DIR}/tokens" - echo "directories.tokendir = ${SOFTHSM2_DIR}/tokens" > "${SOFTHSM2_CONF}" - echo "objectstore.backend = file" >> "${SOFTHSM2_CONF}" - echo "log.level = DEBUG" >> "${SOFTHSM2_CONF}" - softhsm2-util --init-token --free --pin 1234 --so-pin 1234 --label "softhsm2" | awk '/^The token has been initialized and is reassigned to slot/ { print $NF }' -fi -exit 0