feat(v2): add realtime command and release tooling

This commit is contained in:
ila
2026-07-22 21:28:57 +08:00
parent a98005e631
commit 536396f373
9 changed files with 367 additions and 10 deletions
+22
View File
@@ -0,0 +1,22 @@
package main
import (
"strings"
"testing"
"silverpose/v2/internal/config"
)
func TestValidateStartupRejectsMissingRuntimeWithoutLeakingSource(t *testing.T) {
err := validateStartup(config.Config{
Source: config.SourceConfig{URL: "rtsp://operator:secret@example/Streaming/Channels/101"},
Model: config.ModelConfig{ONNXPath: "missing-model.onnx", SHA256: strings.Repeat("a", 64), ONNXRuntimeDLLPath: "missing-runtime.dll"},
Tools: config.ToolConfig{FFmpegPath: "missing-ffmpeg.exe", FFprobePath: "missing-ffprobe.exe"},
})
if err == nil {
t.Fatal("expected missing runtime error")
}
if strings.Contains(err.Error(), "rtsp://") || strings.Contains(err.Error(), "secret") {
t.Fatalf("startup error leaked source: %v", err)
}
}