(t *testing.T)
| 113 | } |
| 114 | |
| 115 | func 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 | |
| 154 | func TestProcFilter(t *testing.T) { |
| 155 | parent := &pstypes.PS{ |
nothing calls this directly
no test coverage detected