Skip to content

Commit 5c92896

Browse files
yosuke-wolfsslejohnstown
authored andcommitted
Run the API tests in the TPM CI job
- No job compiled a wolfSSH test binary with WOLFSSH_TPM defined, so a test guarded on it compiled out everywhere and could not gate a merge. This job enables TPM but only builds; the jobs that run make check do not enable it. - Add a make check step. automake's check-am builds every check_PROGRAM regardless of the TESTS override, so this is the only job that compiles wolfSSH's tests with TPM support. - Override TESTS to run only tests/api.test, the one suite with TPM-specific tests. kex.test also aborts in the example client, which demands -K in a TPM build. - Restrict it to one matrix cell. The 2x2x2 matrix varies the simulator and the host key, neither of which these tests touch. - Assert -DWOLFSSH_TPM in AM_CPPFLAGS first. A build without it compiles the guarded tests out and still exits 0, a hollow pass. - Dump tests/api.log on failure and archive it.
1 parent 1644bb7 commit 5c92896

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/tpm-ssh.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,25 @@ jobs:
115115
sudo make install
116116
sudo ldconfig
117117
118+
# Builds every check_PROGRAM -- no other job compiles wolfSSH's tests
119+
# with TPM support -- but runs only api.test, the one suite with TPM
120+
# tests. One cell: these tests ignore the simulator and host key.
121+
- name: Run API tests
122+
if: matrix.keytype == 'ecc' && matrix.sim == 'ibmswtpm2' && matrix.hostkey == 'raw'
123+
run: |
124+
cd wolfssh
125+
# A non-TPM build compiles every TPM-guarded test out, silently.
126+
if ! grep -q '^AM_CPPFLAGS = .*-DWOLFSSH_TPM' Makefile; then
127+
echo "Not a TPM build; the TPM-guarded tests would compile out."
128+
grep '^AM_CPPFLAGS' Makefile
129+
exit 1
130+
fi
131+
make check TESTS=tests/api.test
132+
133+
- name: Show API test log on failure
134+
if: failure() && (matrix.keytype == 'ecc' && matrix.sim == 'ibmswtpm2' && matrix.hostkey == 'raw')
135+
run: cat wolfssh/tests/api.log || true
136+
118137
# Server host key resident in the TPM: the private key never enters RAM.
119138
- name: Test TPM host key (${{ matrix.keytype }})
120139
if: matrix.hostkey == 'raw'
@@ -222,3 +241,4 @@ jobs:
222241
wolfssh/tpmcert_client.txt
223242
wolfssh/tpmcert_server_neg.txt
224243
wolfssh/tpmcert_client_neg.txt
244+
wolfssh/tests/api.log

0 commit comments

Comments
 (0)