fix legacy SCUM RCON runtime profile resolution
This commit is contained in:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user