diff --git a/tools/coturn-test-check.sh b/tools/coturn-test-check.sh index 87e87e7..d1a7f66 100755 --- a/tools/coturn-test-check.sh +++ b/tools/coturn-test-check.sh @@ -179,10 +179,16 @@ else # confirmed correctly reporting success (exit 0, real packet-loss # stats) with valid credentials and failure ("Cannot complete # Allocation", exit 255) with a wrong password. - OUT="$(docker exec coturn timeout 10 turnutils_uclient -u "$_u" -w "$_p" -y "$TEST_HOST" -p "$COTURN_PORT" 2>&1)" + OUT="$(docker exec coturn timeout 20 turnutils_uclient -u "$_u" -w "$_p" -y "$TEST_HOST" -p "$COTURN_PORT" 2>&1)" RC=$? if [ "$RC" -eq 0 ]; then ok "$c: TURN allocation succeeded (credentials + relay range + reachability all confirmed working)" + elif [ "$RC" -eq 124 ]; then + # timeout(1)'s own exit code — no error was printed yet when the + # clock ran out, so this isn't a reported failure like "Cannot + # complete Allocation" would be. Worth a look, not a hard FAIL. + warn "$c: TURN test didn't finish within 20s (no error printed — likely still negotiating). Raw output so far:" + echo "$OUT" | tail -n 15 | sed 's/^/ /' else fail "$c: TURN allocation failed (exit $RC) — raw output:" echo "$OUT" | tail -n 15 | sed 's/^/ /' diff --git a/tools/pstn-test-check.sh b/tools/pstn-test-check.sh index 58f781a..5a75919 100755 --- a/tools/pstn-test-check.sh +++ b/tools/pstn-test-check.sh @@ -232,9 +232,19 @@ else # packet-loss stats) with valid credentials and correctly fails # ("Cannot complete Allocation", exit 255) with a wrong password — # a real pass/fail signal, not just "didn't crash." - OUT="$(docker exec "$COTURN_CONTAINER" timeout 10 turnutils_uclient -u "$TURN_USERNAME" -w "$TURN_PASSWORD" -y 127.0.0.1 -p "${TURN_PORT:-3478}" 2>&1)" - if [ $? -eq 0 ]; then + OUT="$(docker exec "$COTURN_CONTAINER" timeout 20 turnutils_uclient -u "$TURN_USERNAME" -w "$TURN_PASSWORD" -y 127.0.0.1 -p "${TURN_PORT:-3478}" 2>&1)" + RC=$? + if [ "$RC" -eq 0 ]; then ok "Live TURN allocation succeeded with Asterisk's own configured credentials (user '$TURN_USERNAME')" + elif [ "$RC" -eq 124 ]; then + # timeout(1)'s own exit code — the process was still running + # (no error printed yet) when the clock ran out, not a reported + # failure. Different from an actual auth/allocation error, so + # don't conflate the two — a real error prints its own message + # (e.g. "Cannot complete Allocation") well before this. + warn "TURN test with Asterisk's credentials didn't finish within 20s (no error printed — likely still negotiating). Raw output so far:" + echo "$OUT" | tail -n 15 | sed 's/^/ /' + warn "Try running manually with more time: docker exec $COTURN_CONTAINER turnutils_uclient -u $TURN_USERNAME -w $TURN_PASSWORD -y 127.0.0.1 -p ${TURN_PORT:-3478}" else fail "Live TURN allocation FAILED with Asterisk's configured credentials — raw output:" echo "$OUT" | tail -n 15 | sed 's/^/ /'