feat(boot-test): test.yaml unboundPorts for ports opened only when a player connects

Some servers open a published port only once a player connects (through a
proxy, for example), so the boot test's port check can't see it after boot.
A template lists those ports as unboundPorts in its test.yaml, with the
reason. The first template that needs it lists one UDP port, until a real
client confirms how players reach it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gregandClaude Opus 5.5 committed 2026-10-26 00:42:33 -04:00
1 parent 0dc784dfa2
commit d225e49a8a
4 files changed
+35 -1

No files matched your search

+11 -1
View File
@@ -136,10 +136,20 @@ func bootTestPayload(gamesDir, id string, fillBlank bool) (map[string]any, error
}
}
// Once up, the server must listen on what nodes publish: the container side of every default port
// test.yaml's unboundPorts are published but only opened once a player connects; each is listed by
// hand, with the reason in a comment
unbound := map[string]bool{}
if list, ok := test["unboundPorts"].([]any); ok {
for _, p := range list {
unbound[fmt.Sprint(p)] = true
}
}
expectPorts := []any{}
if ports, ok := g["defaultPorts"].([]any); ok {
for _, p := range ports {
expectPorts = append(expectPorts, fmt.Sprint(p))
if !unbound[fmt.Sprint(p)] {
expectPorts = append(expectPorts, fmt.Sprint(p))
}
}
}