Support TXT uploads and extend XigmaNAS event parsing

This commit is contained in:
2026-02-04 22:25:43 +03:00
parent ae588ae75a
commit 92134a6cc1
6 changed files with 296 additions and 5 deletions

View File

@@ -91,4 +91,26 @@ func TestParserParseExample(t *testing.T) {
if len(result.Events) == 0 {
t.Fatal("expected events from uptime/zfs sections")
}
var hasSystemLog, hasSmartdLog, hasDaemonLog, hasLoginFailure bool
for _, ev := range result.Events {
if ev.EventType == "System Log" {
hasSystemLog = true
}
if ev.EventType == "SMARTD Log" {
hasSmartdLog = true
}
if ev.EventType == "Daemon Log" {
hasDaemonLog = true
}
if strings.Contains(strings.ToLower(ev.Description), "login failure") {
hasLoginFailure = true
}
}
if !hasSystemLog || !hasSmartdLog || !hasDaemonLog {
t.Fatalf("expected events from System/SMARTD/Daemon sections, got system=%v smartd=%v daemon=%v", hasSystemLog, hasSmartdLog, hasDaemonLog)
}
if !hasLoginFailure {
t.Fatal("expected to parse login failure event from system log section")
}
}