任务执行1-19

This commit is contained in:
zxr
2026-06-26 12:51:50 +08:00
parent 175d9f8f94
commit 19908230f2
19 changed files with 2615 additions and 1260 deletions

View File

@@ -0,0 +1,24 @@
package models
import (
"reflect"
"testing"
)
func TestTrapDictionaryEntryHasBlueprintFields(t *testing.T) {
typ := reflect.TypeOf(TrapDictionaryEntry{})
for _, name := range []string{"Vendor", "OID", "Name", "SeverityMappingJSON", "ParseExpression"} {
if _, ok := typ.FieldByName(name); !ok {
t.Fatalf("TrapDictionaryEntry missing blueprint field %s", name)
}
}
}
func TestSyslogRuleHasBlueprintFields(t *testing.T) {
typ := reflect.TypeOf(SyslogRule{})
for _, name := range []string{"SourceMatch", "MessageRegex", "SeverityMappingJSON", "ResourceUIDExtractRegex"} {
if _, ok := typ.FieldByName(name); !ok {
t.Fatalf("SyslogRule missing blueprint field %s", name)
}
}
}