From e1d5459339d7417cda45a7fa0d3c47db555ae6a9 Mon Sep 17 00:00:00 2001 From: Kirill Isakov Date: Wed, 16 Mar 2022 19:34:17 +0600 Subject: [PATCH] CI: add tests with OpenSSL 3.0 --- .ci/deps.sh | 27 ++++++++++++++++++++++++++- .ci/test/run.sh | 7 +++++++ .github/workflows/test.yml | 12 +++++++++--- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/.ci/deps.sh b/.ci/deps.sh index 49a7772f..2f0dab2d 100755 --- a/.ci/deps.sh +++ b/.ci/deps.sh @@ -54,7 +54,7 @@ deps_linux_rhel() { yum upgrade -y yum install -y \ - git binutils make autoconf automake gcc diffutils sudo texinfo-tex netcat procps systemd \ + git binutils make autoconf automake gcc diffutils sudo texinfo-tex netcat procps systemd perl-IPC-Cmd \ findutils socat lzo-devel zlib-devel lz4-devel ncurses-devel readline-devel libgcrypt-devel "$@" if yum info openssl11-devel; then @@ -68,6 +68,29 @@ deps_linux_rhel() { fi } +linux_openssl3() { + if [ -n "${HOST:-}" ]; then + echo >&2 "Not installing OpenSSL 3 to a cross-compilation job" + return + fi + + src=/usr/local/src/openssl + ssl3=/opt/ssl3 + + mkdir -p $src + + git clone --depth 1 --branch openssl-3.0.2 https://github.com/openssl/openssl $src + cd $src + + ./Configure --prefix=$ssl3 --openssldir=$ssl3 + make -j"$(nproc)" + make install_sw + + ldconfig -v $ssl3/lib64 + + cd - +} + deps_linux() { . /etc/os-release @@ -78,10 +101,12 @@ deps_linux() { debian | ubuntu) deps_linux_debian "$@" + linux_openssl3 ;; centos | almalinux | fedora) deps_linux_rhel "$@" + linux_openssl3 ;; *) exit 1 ;; diff --git a/.ci/test/run.sh b/.ci/test/run.sh index a7cfc299..2d1eb07d 100644 --- a/.ci/test/run.sh +++ b/.ci/test/run.sh @@ -86,6 +86,13 @@ nolegacy) gcrypt) run_tests gcrypt --with-libgcrypt ;; +openssl3) + if [ -d /opt/ssl3 ]; then + run_tests openssl3 --with-openssl=/opt/ssl3 --with-openssl-include=/opt/ssl3/include --with-openssl-lib=/opt/ssl3/lib64 + else + echo >&2 "OpenSSL 3 not installed, skipping test" + fi + ;; *) bail "unknown test flavor $1" ;; diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index be2401f1..b5392ff2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,7 @@ jobs: static-analysis: runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 30 steps: - name: Checkout code uses: actions/checkout@v1 @@ -115,7 +115,7 @@ jobs: sanitizer: runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -133,6 +133,9 @@ jobs: - name: Install deps run: sudo sh .ci/deps.sh + - name: Run tests with OpenSSL 3 + run: bash .ci/sanitizers/run.sh openssl3 + - name: Sanitize tests with default settings run: bash .ci/sanitizers/run.sh default @@ -149,7 +152,7 @@ jobs: linux: runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -181,6 +184,9 @@ jobs: - name: Create a non-privileged user run: sh .ci/test/prepare.sh + - name: Run tests with OpenSSL 3 + run: sudo -u build CI=1 sh .ci/test/run.sh openssl3 + - name: Run tests with default settings run: sudo -u build CI=1 sh .ci/test/run.sh default -- 2.20.1