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

Function TestCompile

pkg/rules/compiler_test.go:31–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29)
30
31func TestCompile(t *testing.T) {
32 c := newCompiler(new(ps.SnapshotterMock), newConfig("_fixtures/default/*.yml"))
33 filters, rs, err := c.compile()
34 require.NoError(t, err)
35 require.NotNil(t, rs)
36 require.Len(t, filters, 6)
37
38 assert.True(t, rs.HasModuleEvents)
39 assert.True(t, rs.HasProcEvents)
40 assert.False(t, rs.HasMemEvents)
41 assert.False(t, rs.HasAuditAPIEvents)
42 assert.True(t, rs.HasDNSEvents)
43 assert.Contains(t, rs.UsedEvents, event.CreateProcess)
44 assert.Contains(t, rs.UsedEvents, event.LoadModule)
45 assert.Contains(t, rs.UsedEvents, event.QueryDNS)
46 assert.Contains(t, rs.UsedEvents, event.ConnectTCPv4)
47 assert.Contains(t, rs.UsedEvents, event.ConnectTCPv6)
48}
49
50func TestCompileMinEngineVersion(t *testing.T) {
51 var tests = []struct {

Callers

nothing calls this directly

Calls 5

newCompilerFunction · 0.85
newConfigFunction · 0.85
compileMethod · 0.80
ContainsMethod · 0.80
LenMethod · 0.45

Tested by

no test coverage detected