From d4bde67e0ffcd7ae33e67b119d4bf907add628bd Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Tue, 1 Sep 2026 21:13:04 +0100 Subject: [PATCH] test(multiplayer): harden ranked arena provider boundary --- server/agones/allocation_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/agones/allocation_test.go b/server/agones/allocation_test.go index f94a2eec..f0f94d59 100644 --- a/server/agones/allocation_test.go +++ b/server/agones/allocation_test.go @@ -17,6 +17,18 @@ func request() domain.AllocationRequest { return domain.AllocationRequest{AllocationID: "allocation-1", MatchID: "match-1", Region: "EU", Build: "build-1", Protocol: 1, Transport: "enet"} } +func TestAllocateRejectsRankedRequestsWithoutRegisteredArena(t *testing.T) { + client := Client{BaseURL: "http://127.0.0.1:1", Namespace: "games"} + for _, path := range []string{"", "res://scenes/arena_01_elevated.tscn", "res://forged.tscn"} { + req := request() + req.Playlist = domain.Ranked + req.ArenaPath = path + if _, err := client.Allocate(context.Background(), req, map[string]string{"region": "EU"}, time.Unix(1000, 0)); err != domain.ErrAllocationInput { + t.Fatalf("ranked arena path %q returned %v, want ErrAllocationInput", path, err) + } + } +} + func TestAllocateBuildsStrictGameServerAllocationAndEndpoint(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost || r.URL.Path != "/apis/allocation.agones.dev/v1/namespaces/games/gameserverallocations" {