File tree Expand file tree Collapse file tree 4 files changed +76
-0
lines changed Expand file tree Collapse file tree 4 files changed +76
-0
lines changed Original file line number Diff line number Diff line change 1+ .git
2+ .github
3+ .gitignore
4+ .mypy_cache
5+ .vscode
6+ * .md
7+ ** /__pycache__ /**
8+ docs
9+ Makefile
10+ target
11+ test.db
12+ vendor
Original file line number Diff line number Diff line change 66* .patch
77* NVChip
88.vscode
9+ .cargo /
10+ vendor /
Original file line number Diff line number Diff line change 1+ # USAGE:
2+ # docker build -t tssdev -f ./tss-esapi/tests/Dockerfile-opensuse-tw .
3+ # docker run -v ./:/usr/src/rust-tss-esapi --rm -i -t tssdev
4+ #
5+ # It is a good idea to vendor to prevent repeat crate downloads.
6+ # mkdir .cargo
7+ # cargo vendor > .cargo/config.toml
8+
9+ FROM opensuse/tumbleweed:latest
10+
11+ RUN zypper install -y \
12+ tpm2-0-tss-devel tpm2.0-tools tpm2.0-abrmd \
13+ swtpm \
14+ cargo \
15+ clang \
16+ dbus-1-daemon
17+
18+ # Instead of bind mounting, we could do this instead.
19+ # COPY . /usr/src/rust-tss-esapi
20+
21+ WORKDIR /usr/src/rust-tss-esapi
22+
23+ CMD ["/usr/bin/bash", "tss-esapi/tests/all-opensuse.sh"]
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Copyright 2024 Contributors to the Parsec project.
4+ # SPDX-License-Identifier: Apache-2.0
5+
6+ # This script executes tests for the tss-esapi crate.
7+ # It can be run inside the container which Dockerfile is in the same folder.
8+ #
9+ # Usage: ./tests/all.sh
10+
11+ set -euf -o pipefail
12+
13+ # ###########################
14+ # Run the TPM SWTPM server #
15+ # ###########################
16+ mkdir /tmp/tpmdir
17+ swtpm_setup --tpm2 \
18+ --tpmstate /tmp/tpmdir \
19+ --createek --decryption --create-ek-cert \
20+ --create-platform-cert \
21+ --pcr-banks sha1,sha256 \
22+ --display
23+ swtpm socket --tpm2 \
24+ --tpmstate dir=/tmp/tpmdir \
25+ --flags startup-clear \
26+ --ctrl type=tcp,port=2322 \
27+ --server type=tcp,port=2321 \
28+ --daemon
29+
30+ # ##################
31+ # Build the crate #
32+ # ##################
33+ RUST_BACKTRACE=1 cargo build --features " generate-bindings integration-tests"
34+
35+ # ################
36+ # Run the tests #
37+ # ################
38+ TEST_TCTI=" swtpm:host=localhost,port=2321" RUST_BACKTRACE=1 RUST_LOG=info cargo test --features " generate-bindings integration-tests" -- --test-threads=1 --nocapture
39+
You can’t perform that action at this time.
0 commit comments