Skip to content

Merge pull request #333 from sebastian-carpenter/encode-decode-tests #1139

Merge pull request #333 from sebastian-carpenter/encode-decode-tests

Merge pull request #333 from sebastian-carpenter/encode-decode-tests #1139

Workflow file for this run

name: tpm2-tss Tests
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test_tpm2_tss:
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
matrix:
tpm2_tss_ref: [ '4.1.3']
wolfssl_ref: [ 'v5.8.4-stable' ]
openssl_ref: [ 'openssl-3.5.4' ]
force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ]
replace_default: [ true ]
env:
WOLFSSL_PACKAGES_PATH: /tmp/wolfssl-packages
OPENSSL_PACKAGES_PATH: /tmp/openssl-packages
WOLFPROV_PACKAGES_PATH: /tmp/wolfprov-packages
steps:
- name: Install test dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libcunit1-dev autoconf-archive \
gettext libcmocka-dev build-essential autoconf automake libtool \
libjson-c-dev libcurl4-openssl-dev acl libusb-1.0-0-dev git \
pkg-config uuid-dev
# ensure libssl-dev is not installed
- name: Ensure libssl-dev is not installed
run: |
if dpkg -l | grep -q libssl-dev; then
echo "libssl-dev is installed, removing it to avoid conflicts"
sudo apt-get remove -y libssl-dev
else
echo "libssl-dev is not installed, no action needed"
fi
- name: Checkout wolfProvider
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build wolfProvider
run: |
OPENSSL_TAG=${{ matrix.openssl_ref }} WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh
- name: Checkout tpm2-tss
uses: actions/checkout@v4
with:
repository: tpm2-software/tpm2-tss
path: tpm2_tss_repo
ref: ${{ matrix.tpm2_tss_ref }}
fetch-depth: 1
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
fetch-depth: 1
- run: |
cd tpm2_tss_repo
patch -p1 < $GITHUB_WORKSPACE/osp/wolfProvider/libtss2/libtss2-${{ matrix.tpm2_tss_ref }}-wolfprov.patch
- name: Build and install tpm2-tss
working-directory: tpm2_tss_repo
run: |
source $GITHUB_WORKSPACE/scripts/env-setup
./bootstrap
./configure --prefix=$PWD/tpm2-tss-install --with-crypto=ossl \
--enable-unit
make -j$(nproc)
make install
- name: Run tpm2-tss tests
working-directory: tpm2_tss_repo
run: |
source $GITHUB_WORKSPACE/scripts/env-setup
export ${{ matrix.force_fail }}
make check 2>&1 || true
if $(grep -q "FAIL: test/unit" test-suite.log); then
TEST_RESULT=1
echo "Expected zero failures"
else
TEST_RESULT=0
fi
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} tpm2-tss