Skip to content

Commit

Permalink
tests: fix installed test-tpm12
Browse files Browse the repository at this point in the history
Use an absolute path for TESTDIR, as we refer to it from different
directories.

Also fix killing gone swtpm process.

Signed-off-by: Marc-André Lureau <[email protected]>
  • Loading branch information
elmarco authored and stefanberger committed Aug 27, 2024
1 parent d93a6c2 commit fe4b82c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_tpm12
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ if [ "${SWTPM_TEST_EXPENSIVE:-0}" -eq 0 ]; then
exit 77
fi

ROOT=${abs_top_builddir:-$(pwd)/..}
TESTDIR=${abs_top_testdir:-${PWD}/$(dirname "$0")}
ROOT=${abs_top_builddir:-$(dirname "$0")/..}
TESTDIR=${abs_top_testdir:-$(dirname "$0")}
TESTDIR=$(realpath "${TESTDIR}")

function cleanup() {
if [ -n "${SWTPM_PID}" ]; then
Expand Down Expand Up @@ -137,9 +138,11 @@ done

$SWTPM_IOCTL --tcp :65441 -s
wait_process_gone "${SWTPM1_PID}" 4
SWTPM1_PID=

$SWTPM_IOCTL --tcp :65443 -s
wait_process_gone "${SWTPM_PID}" 4
SWTPM_PID=

popd &>/dev/null || exit 1
popd &>/dev/null || exit 1
Expand Down

0 comments on commit fe4b82c

Please sign in to comment.