File tree Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Original file line number Diff line number Diff line change @@ -121,3 +121,14 @@ jobs:
121121 run : docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.74.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh
122122 - name : Check Clippy lints latest
123123 run : docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh
124+
125+ # Check that examples builds can be executed.
126+ tests-examples :
127+ name : Check examples
128+ runs-on : ubuntu-latest
129+ steps :
130+ - uses : actions/checkout@v5
131+ - name : Build the container
132+ run : docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-abrmd
133+ - name : Run the container
134+ run : docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/examples.sh
Original file line number Diff line number Diff line change @@ -28,6 +28,15 @@ RUN cd tpm2-tools \
2828 && ./configure \
2929 && make install
3030
31+ FROM tpm2-tools AS tpm2-abrmd
32+ # Download and install TPM2 ABRMD
33+ RUN git clone https://github.com/tpm2-software/tpm2-abrmd.git --branch 3.0.0
34+ RUN cd tpm2-abrmd \
35+ && ./bootstrap \
36+ && ./configure \
37+ && make install \
38+ && ldconfig
39+
3140FROM tpm2-tools AS tpm2-tss-install-dir
3241# TPM2_TSS_PATH is the env variable build.rs looks for
3342# an installation.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Copyright 2019 Contributors to the Parsec project.
4+ # SPDX-License-Identifier: Apache-2.0
5+
6+ # This script builds and tests the examples.
7+ # It can be run inside the container which Dockerfile
8+ # is in the same folder.
9+
10+ set -euf -o pipefail
11+
12+ # ################################################
13+ # Change rust toolchain version
14+ # ################################################
15+ if [[ ! -z ${RUST_TOOLCHAIN_VERSION: +x} ]]; then
16+ rustup override set ${RUST_TOOLCHAIN_VERSION}
17+ # Use the frozen Cargo lock to prevent any drift from MSRV being upgraded
18+ # underneath our feet.
19+ cp tests/Cargo.lock.frozen ../Cargo.lock
20+ fi
21+
22+ useradd --system --user-group tss
23+
24+ # ################################
25+ # Run the TPM simulation server #
26+ # ################################
27+ tpm_server &
28+ sleep 5
29+
30+ # ###################
31+ # Start tpm2-abrmd #
32+ # ###################
33+ pkill -HUP dbus-daemon
34+ systemctl daemon-reload
35+ tpm2-abrmd \
36+ --logger=stdout \
37+ --tcti=mssim \
38+ --allow-root \
39+ --session \
40+ --flush-all &
41+
42+ # ################
43+ # Clear the TPM #
44+ # ################
45+ tpm2_startup -clear -T tabrmd
46+
47+ # ###################
48+ # Run the examples #
49+ # ###################
50+ TEST_TCTI=tabrmd: RUST_BACKTRACE=1 RUST_LOG=info cargo run --example certify
You can’t perform that action at this time.
0 commit comments