Skip to content

Commit a75043b

Browse files
committed
Add valgrind CI run
Signed-off-by: Ionut Mihalcea <[email protected]>
1 parent 167eded commit a75043b

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,13 @@ jobs:
6969
run: docker build -t fedoracontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-fedora
7070
- name: Run the tests
7171
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi fedoracontainer dbus-run-session -- /tmp/rust-tss-esapi/tss-esapi/tests/all-fedora.sh
72+
73+
tests-valgrind:
74+
name: Valgrind test run
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v2
78+
- name: Build the container
79+
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
80+
- name: Run the tests
81+
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/valgrind.sh

tss-esapi/tests/valgrind.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2022 Contributors to the Parsec project.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
# Script for running valgrind against the set of tests
7+
# Intended for running in the Ubuntu container
8+
9+
set -euf -o pipefail
10+
11+
#################################
12+
# Run the TPM simulation server #
13+
#################################
14+
tpm_server &
15+
sleep 5
16+
tpm2_startup -c -T mssim
17+
18+
##########################
19+
# Install cargo-valgrind #
20+
##########################
21+
apt install -y valgrind
22+
cargo install cargo-valgrind
23+
24+
#################
25+
# Run the tests #
26+
#################
27+
TEST_TCTI=mssim: RUST_BACKTRACE=1 RUST_LOG=info cargo valgrind test -- --test-threads=1 --nocapture

0 commit comments

Comments
 (0)