Add SCUM log sessions and trajectory projections
This commit is contained in:
@@ -17,4 +17,24 @@ func TestConsoleSemanticEventProducerParsesOnlyBoundedKnownOutput(t *testing.T)
|
||||
if batch.Events[0].NetworkCorrelation == "10.0.0.1" {
|
||||
t.Fatal("raw network value leaked")
|
||||
}
|
||||
if len(batch.Events[0].NetworkCorrelation) != 64 {
|
||||
t.Fatalf("network correlation must be full sha256 hex, got %q", batch.Events[0].NetworkCorrelation)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConsoleSemanticEventProducerParsesScumLoginLog(t *testing.T) {
|
||||
observedAt := time.Date(2026, 8, 27, 12, 0, 0, 0, time.UTC)
|
||||
batch := ParseConsoleRecords("server-1", []ConsoleRecord{
|
||||
{ServerID: "server-1", Stream: "stdout", Sequence: 1, OccurredAt: observedAt, Text: "2026.08.27-12.00.00: '10.0.0.2 76561198000000002:Ada(42)' logged in at: X=1 Y=2 Z=3"},
|
||||
{ServerID: "server-1", Stream: "stdout", Sequence: 2, OccurredAt: observedAt.Add(time.Second), Text: "2026.08.27-12.00.01: '10.0.0.2 76561198000000002:Ada(42)' logged out"},
|
||||
}, "fixture-secret")
|
||||
if len(batch.Events) != 2 || batch.Events[0].Type != "scum.login" || batch.Events[1].Type != "scum.logout" {
|
||||
t.Fatalf("login log events not parsed: %+v", batch)
|
||||
}
|
||||
if batch.Events[0].PlayerID != "76561198000000002" || batch.Events[0].DisplayName != "Ada" || len(batch.Events[0].NetworkCorrelation) != 64 {
|
||||
t.Fatalf("login event fields are incomplete: %+v", batch.Events[0])
|
||||
}
|
||||
if batch.Events[0].NetworkCorrelation == "10.0.0.2" {
|
||||
t.Fatal("raw login log IP leaked")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user