fix legacy SCUM RCON runtime profile resolution
This commit is contained in:
@@ -41,6 +41,29 @@ func TestRegisteredRuntimeProfilesSurviveFileStoreReload(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLegacyLocalRuntimeBindingCanonicalizesToUnambiguousLocalProcessProfile(t *testing.T) {
|
||||
plugin := domain.GamePlugin{RuntimeProfiles: domain.GamePluginRuntimeProfiles{
|
||||
LifecycleProfiles: []domain.RuntimeLifecycleProfile{{Key: "run-local", Mode: "local-process"}},
|
||||
}}
|
||||
binding, err := normalizeRuntimeBinding(plugin, domain.RuntimeBinding{ID: "binding-legacy", ServerInstanceID: "server-legacy", PluginID: "plugin-legacy", PluginVersion: "1.0.0", ProfileKey: "local", Bindings: map[string]string{}, CreatedAt: fixedTime, UpdatedAt: fixedTime})
|
||||
if err != nil {
|
||||
t.Fatalf("normalize legacy runtime binding: %v", err)
|
||||
}
|
||||
if binding.ProfileKey != "run-local" || binding.Mode != "local-process" {
|
||||
t.Fatalf("expected canonical local-process profile, got %+v", binding)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLegacyLocalRuntimeBindingDoesNotGuessAmbiguousProfiles(t *testing.T) {
|
||||
profiles := domain.GamePluginRuntimeProfiles{LifecycleProfiles: []domain.RuntimeLifecycleProfile{
|
||||
{Key: "run-local", Mode: "local-process"},
|
||||
{Key: "run-local-alt", Mode: "local-process"},
|
||||
}}
|
||||
if _, ok := runtimeLifecycleProfile(profiles, "local"); ok {
|
||||
t.Fatal("expected ambiguous legacy local profile lookup to fail")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRuntimeBindingValidationAndLifecycleGating(t *testing.T) {
|
||||
svc := newTestCoreService()
|
||||
plugin, endpoint := createPluginAndRunEndpoint(t, svc)
|
||||
|
||||
Reference in New Issue
Block a user