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

Function TestMakeSequenceLinkID

pkg/filter/filter_test.go:115–152  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

113}
114
115func TestMakeSequenceLinkID(t *testing.T) {
116 var tests = []struct {
117 valuer ql.MapValuer
118 seqLink *ql.SequenceLink
119 id any
120 }{
121 {ql.MapValuer{
122 "ps.uuid": uint64(123232454234232132),
123 "ps.exe": "C:\\Windows\\System32\\cmd.exe"},
124 &ql.SequenceLink{Fields: []*ql.FieldLiteral{{Value: "ps.exe"}, {Value: "ps.uuid"}}},
125 "433a5c57696e646f77735c53797374656d33325c636d642e65786544556ea343cfb501",
126 },
127 {ql.MapValuer{
128 "ps.uuid": uint64(123232454234232132),
129 "module.address": uint64(0xfff32343)},
130 &ql.SequenceLink{Fields: []*ql.FieldLiteral{{Value: "ps.uuid"}, {Value: "module.address"}}},
131 "44556ea343cfb5014323f3ff00000000",
132 },
133 {ql.MapValuer{
134 "ps.uuid": uint64(123232454234232132),
135 "ps.exe": "C:\\Windows\\System32\\cmd.exe"},
136 &ql.SequenceLink{Fields: []*ql.FieldLiteral{{Value: "ps.exe"}}},
137 "C:\\Windows\\System32\\cmd.exe",
138 },
139 {ql.MapValuer{
140 "ps.uuid": uint64(123232454234232132),
141 "ps.exe": "C:\\Windows\\System32\\cmd.exe"},
142 &ql.SequenceLink{Fields: []*ql.FieldLiteral{{Value: "ps.uuid"}}},
143 uint64(123232454234232132),
144 },
145 }
146
147 for _, tt := range tests {
148 t.Run(fmt.Sprintf("%v", tt.valuer), func(t *testing.T) {
149 assert.Equal(t, tt.id, makeSequenceLinkID(tt.valuer, tt.seqLink))
150 })
151 }
152}
153
154func TestProcFilter(t *testing.T) {
155 parent := &pstypes.PS{

Callers

nothing calls this directly

Calls 3

makeSequenceLinkIDFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected