From fe4b82c62dcce5fb65aaa47b1a9a939be30ce6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 9 Jul 2024 12:34:51 +0400 Subject: [PATCH] tests: fix installed test-tpm12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/test_tpm12 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_tpm12 b/tests/test_tpm12 index 4affb02fb..dfae31f11 100755 --- a/tests/test_tpm12 +++ b/tests/test_tpm12 @@ -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 @@ -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