feat(gateway): parse Apollo inventory and launch replies
Verify Data Plane / gateway (push) Successful in 1m58s

This commit is contained in:
sechmachine
2026-07-29 11:34:40 +07:00
parent 994fe38fb9
commit 1357ea0c8f
2 changed files with 58 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
package gateway
import "testing"
func TestApolloInventoryAndLaunchResponseRequireExactApplicationAndSuccess(t *testing.T) {
inventory := []byte(`<root><App><ID>41</ID></App><App><ID>42</ID></App></root>`)
if !apolloInventoryContains(inventory, "42") || apolloInventoryContains(inventory, "420") {
t.Fatal("apolloInventoryContains() did not require an exact inventory ID")
}
if _, err := parseApolloLaunchResponse([]byte(`<root status_code="200"><sessionUrl0>rtspenc://apollo.test:47984</sessionUrl0></root>`)); err != nil {
t.Fatalf("parseApolloLaunchResponse() error = %v", err)
}
if _, err := parseApolloLaunchResponse([]byte(`<root status_code="403"><sessionUrl0>rtspenc://apollo.test:47984</sessionUrl0></root>`)); err == nil {
t.Fatal("parseApolloLaunchResponse() accepted a denied launch")
}
}