Say what the e2e's WebRTC assertion actually proves

go2rtc is not running in this test, so the gateway cannot reach it and
the message "its go2rtc answered (as a refusal)" was wrong. What the
assertion really establishes is that the offer travelled
cloud -> uplink -> gateway at all, which a timeout would not.

Records that the happy path was verified by hand - the real go2rtc and a
valid offer return 200 with an answer SDP carrying go2rtc's own host and
server-reflexive candidates - and why that is not automated here: it
needs a live camera and go2rtc installed, and this script should not
depend on either.
This commit is contained in:
2026-10-19 00:37:27 +00:00
parent f02c9897c9
commit dddfff6800
+9 -2
View File
@@ -349,8 +349,15 @@ else
-H "$AUTH_HEADER" -H 'Content-Type: application/json' \ -H "$AUTH_HEADER" -H 'Content-Type: application/json' \
-d '{"sdp":"v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"}' \ -d '{"sdp":"v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"}' \
"$BASE/printers/$CAM_UUID/webrtc")" "$BASE/printers/$CAM_UUID/webrtc")"
if [ "$OFFER_CODE" = "503" ] && grep -q 'go2rtc\|connection refused\|refused the offer' "$WORK/offer.json"; then # go2rtc is deliberately not running here, so the expected answer is the
ok "the WebRTC offer reached the gateway and its go2rtc answered (as a refusal): $(head -c 160 "$WORK/offer.json")" # gateway reporting that it could not reach it - which still proves the
# offer travelled cloud -> uplink -> gateway. A timeout would mean it did
# not. Verified once by hand with the real go2rtc and a valid offer, which
# returns a 200 and an answer SDP carrying go2rtc's own ICE candidates;
# that is not automated here because it needs a live camera and go2rtc
# installed, which would make this script depend on both.
if [ "$OFFER_CODE" = "503" ] && grep -q 'go2rtc' "$WORK/offer.json"; then
ok "the WebRTC offer round-tripped to the gateway: $(head -c 170 "$WORK/offer.json")"
elif [ "$OFFER_CODE" = "503" ] && grep -q 'did not answer within' "$WORK/offer.json"; then elif [ "$OFFER_CODE" = "503" ] && grep -q 'did not answer within' "$WORK/offer.json"; then
fail "the gateway never answered the offer - the relay did not round-trip: $(cat "$WORK/offer.json")" fail "the gateway never answered the offer - the relay did not round-trip: $(cat "$WORK/offer.json")"
else else