mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-09-09 19:59:55 +00:00
psasim: add timeout while waiting for psa_server to start
Signed-off-by: Valerio Setti <[email protected]>
This commit is contained in:
@@ -8,7 +8,14 @@ set -e
|
|||||||
# The server creates some local files when it starts up so we can wait for this
|
# The server creates some local files when it starts up so we can wait for this
|
||||||
# event as signal that the server is ready so that we can start client(s).
|
# event as signal that the server is ready so that we can start client(s).
|
||||||
function wait_for_server_startup() {
|
function wait_for_server_startup() {
|
||||||
|
SECONDS=0
|
||||||
|
TIMEOUT=10
|
||||||
|
|
||||||
while [ $(find . -name "psa_notify_*" | wc -l) -eq 0 ]; do
|
while [ $(find . -name "psa_notify_*" | wc -l) -eq 0 ]; do
|
||||||
|
if [ "$SECONDS" -ge "$TIMEOUT" ]; then
|
||||||
|
echo "Timeout: psa_server not started within $TIMEOUT seconds."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user