Skip to content

Commit a40cc17

Browse files
committed
Retry the fullstack HTTPS probe so a slow sim start does not fail it
1 parent 1b63b1c commit a40cc17

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

fullstack/freertos-wolfip-wolfssl-https/test_https.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ if ! ip link show wtap0 >/dev/null 2>&1; then
1515
fi
1616

1717
echo "Testing HTTPS server with curl..."
18-
curl -v --cacert ./certs/ca-cert.pem \
19-
--tlsv1.3 --insecure https://10.10.0.10:443/
2018

21-
# Check if curl command succeeded
22-
if [ $? -eq 0 ]; then
23-
echo "HTTPS test successful!"
24-
else
25-
echo "HTTPS test failed!"
26-
exit 1
27-
fi
19+
# The sim's cooperative scheduler can be slow to bind :443 on a loaded host, so
20+
# retry rather than fail on a single connection refusal.
21+
attempts=30
22+
for i in $(seq 1 "$attempts"); do
23+
curl -v --cacert ./certs/ca-cert.pem \
24+
--tlsv1.3 --insecure https://10.10.0.10:443/ && break
25+
if [ "$i" -eq "$attempts" ]; then
26+
echo "HTTPS test failed!"
27+
exit 1
28+
fi
29+
sleep 1
30+
done
31+
32+
echo "HTTPS test successful!"

0 commit comments

Comments
 (0)