MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / fireRules

Function fireRules

pkg/rules/engine_test.go:117–135  ·  view source on GitHub ↗
(t *testing.T, c *config.Config)

Source from the content-addressed store, hash-verified

115}
116
117func fireRules(t *testing.T, c *config.Config) bool {
118 e := NewEngine(new(ps.SnapshotterMock), c)
119 evt := &event.Event{
120 Type: event.RecvTCPv4,
121 Name: "Recv",
122 Tid: 2484,
123 PID: 859,
124 Category: event.Net,
125 Params: event.Params{
126 params.NetDport: {Name: params.NetDport, Type: params.Uint16, Value: uint16(443)},
127 params.NetSport: {Name: params.NetSport, Type: params.Uint16, Value: uint16(43123)},
128 params.NetSIP: {Name: params.NetSIP, Type: params.IPv4, Value: net.ParseIP("127.0.0.1")},
129 params.NetDIP: {Name: params.NetDIP, Type: params.IPv4, Value: net.ParseIP("216.58.201.174")},
130 },
131 Metadata: make(map[event.MetadataKey]any),
132 }
133 compileRules(t, e)
134 return wrapProcessEvent(evt, e.ProcessEvent)
135}
136
137func TestCompileIndexableFilters(t *testing.T) {
138 e := NewEngine(new(ps.SnapshotterMock), newConfig(

Callers 1

TestRunSimpleRulesFunction · 0.85

Calls 3

NewEngineFunction · 0.85
compileRulesFunction · 0.85
wrapProcessEventFunction · 0.85

Tested by

no test coverage detected