mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-08-14 16:39:49 +00:00
tests: Wait for PID file rather than reading it right away
Wait for the PID file to appear rather than reading it right away. This addresses an issue when runnin the test suite under valgrind (make -j $(nproc) check). Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
9c2e4dc58a
commit
f59c33009d
@ -86,16 +86,12 @@ if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -r $PID_FILE ]; then
|
||||
echo "Error: CUSE TPM did not write pidfile."
|
||||
if wait_for_file $PID_FILE 3; then
|
||||
echo "Error: ${SWTPM_INTERFACE} TPM did not write pidfile."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PIDF="$(cat $PID_FILE)"
|
||||
if [ "$PIDF" != "$PID" ]; then
|
||||
echo "Error: CUSE TPM wrote pid $PIDF, but found $PID."
|
||||
exit 1
|
||||
fi
|
||||
validate_pidfile $PID $PID_FILE
|
||||
|
||||
${SWTPM_BIOS} &>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
@ -160,7 +156,7 @@ exec 100>&-
|
||||
|
||||
wait_port_closed $PORT $PID
|
||||
# Give it time to fully shut down
|
||||
wait_process_gone $PID 2
|
||||
wait_process_gone $PID 6
|
||||
|
||||
exec 20<&1-; exec 21<&2-
|
||||
kill_quiet -0 $PID
|
||||
|
||||
Loading…
Reference in New Issue
Block a user