tsctl: stream start/list/watch; smoke test streams on TS6

tsctl connect <addr> stream [--loopback|--stun X|--no-stun]
  start --synthetic [--name] [--auto-accept] [--seconds N] [--fps]
        [--frame-size] [--no-audio]
        Streams SyntheticSource frames through tsc-stream's sessions.
        Without --auto-accept, join requests are answered on stdin
        (accept/deny/kick <clid>, stop). frame_source() is the seam for
        real capture and encoders.
  list  Streams announced in our channel, plus clients whose
        client_is_streaming is set but whose stream id we were not told.
  watch [--id] [--streamer-nick] [--expect-frames N] [--timeout S]
        Joins the matching stream (or the first one); exits 0 once N video
        frames arrived.

it-smoke.sh (TS6 only): a viewer waits for a uniquely named streamer,
which then streams 10 s of synthetic VP8 + Opus over loopback; also runs
the engine's stream_live test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
Claude committed 2026-09-26 05:07:36 +00:00
1 parent 4918fca381
commit b7f8ea8ef2
6 files changed
+560 -1

No files matched your search

+26 -1
View File
@@ -11,6 +11,7 @@
# 6. relay chat: a query relay reads channel chat and posts into the channel
# 7. gateway (tsgw): login with a TeamSpeak identity, presence, channel chat
# both ways, refusal of an identity the server does not know
# 8. stream (TeamSpeak 6 only): a viewer watches a synthetic VP8 + Opus stream
#
# Usage: scripts/it-smoke.sh [ts3|ts6]... (default: both)
# Env: TSCTL=path/to/tsctl (default: builds target/debug/tsctl)
@@ -108,6 +109,27 @@ voice_roundtrip() {
grep "tone ratio" "$out"
}
# TeamSpeak 6: a viewer waits for a stream, a streamer sends synthetic frames.
stream_check() {
local addr=$1 out="$STATE_DIR/stream-watch.log" streamer_out="$STATE_DIR/stream-start.log"
# Unique nicknames: other clients may stream on the same server.
local streamer="streamer-$$-$RANDOM"
"$TSCTL" connect "$addr" --nick "viewer-$$" stream --loopback watch --streamer-nick "$streamer" \
--expect-frames 60 --timeout 30 >"$out" 2>&1 &
local viewer=$!
sleep 2
if ! "$TSCTL" connect "$addr" --nick "$streamer" stream --loopback start --synthetic \
--auto-accept --seconds 10 >"$streamer_out" 2>&1; then
cat "$streamer_out" "$out"
fail "streamer failed"
fi
if ! wait "$viewer"; then
cat "$out" "$streamer_out"
fail "stream frames not received"
fi
grep -E "first video frame|received" "$out"
}
# An observer over ServerQuery must see a voice client join.
presence_check() {
local addr=$1 query=$2 out="$STATE_DIR/observe.log"
@@ -213,10 +235,13 @@ for svc in "${SERVERS[@]}"; do
presence_check "$addr" "${QUERY[$svc]}"
relay_check "$addr" "${QUERY[$svc]}"
gateway_check "$svc" "$addr"
if [[ $svc == ts6 ]]; then
stream_check "$addr"
fi
done
log "engine (tsc-core) against both servers"
TSC_LIVE=1 cargo test --quiet -p tsc-core --test live 2>&1 | grep -E "test result|panicked|timed out" || fail "engine tests failed"
TSC_LIVE=1 cargo test --quiet -p tsc-core --test live --test stream_live 2>&1 | grep -E "test result|panicked|timed out" || fail "engine tests failed"
log "stream (tsc-stream) through the TeamSpeak 6 server"
TSC_LIVE=1 cargo test --quiet -p tsc-stream --test live_ts6 2>&1 | grep -E "test result|panicked|timed out" || fail "stream test failed"