File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 69
69
run : docker build -t fedoracontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-fedora
70
70
- name : Run the tests
71
71
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
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ impl Context {
59
59
auth_hash : HashingAlgorithm ,
60
60
) -> Result < Option < AuthSession > > {
61
61
let mut session_handle = ObjectHandle :: None . into ( ) ;
62
+ let potential_tpm2b_nonce = nonce. map ( |v| v. into ( ) ) ;
62
63
let ret = unsafe {
63
64
Esys_StartAuthSession (
64
65
self . mut_context ( ) ,
@@ -70,7 +71,7 @@ impl Context {
70
71
self . optional_session_1 ( ) ,
71
72
self . optional_session_2 ( ) ,
72
73
self . optional_session_3 ( ) ,
73
- nonce . map_or_else ( null, |v| & v . into ( ) ) ,
74
+ potential_tpm2b_nonce . as_ref ( ) . map_or_else ( null, |v| v ) ,
74
75
session_type. into ( ) ,
75
76
& symmetric. try_into ( ) ?,
76
77
auth_hash. into ( ) ,
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments