fix legacy SCUM RCON runtime profile resolution

This commit is contained in:
npc0-hue
2026-08-24 11:27:08 +08:00
parent b69939a5ce
commit dc9b0eaf2a
4 changed files with 64 additions and 8 deletions
+20
View File
@@ -106,6 +106,26 @@ func TestSourceRCONDispatchRejectsUnsafeOrIncompatibleState(t *testing.T) {
}
}
func TestSourceRCONDispatchCanonicalizesLegacyLocalBinding(t *testing.T) {
svc, _, _, instance := newSourceRCONFixture(t)
plugin, err := svc.store.GamePlugins().Get(instance.PluginID)
if err != nil {
t.Fatal(err)
}
plugin.RuntimeProfiles.LifecycleProfiles[0].Key = "run-local"
if err := svc.store.GamePlugins().Update(plugin); err != nil {
t.Fatalf("update runtime profile key: %v", err)
}
resolution, err := svc.resolveSourceRCONDispatch(instance)
if err != nil {
t.Fatalf("resolve RCON dispatch with legacy binding: %v", err)
}
if resolution.binding.ProfileKey != "run-local" {
t.Fatalf("expected legacy binding to be canonicalized, got %q", resolution.binding.ProfileKey)
}
}
func TestSourceRCONBrokerExpiresWithoutReplay(t *testing.T) {
stamp := fixedTime
broker := newSourceRCONCommandBroker(func() time.Time { return stamp })