MCPcopy
hub / github.com/evilsocket/opensnitch / testFindAllowMatch

Function testFindAllowMatch

daemon/rule/loader_test.go:283–295  ·  view source on GitHub ↗
(t *testing.T, l *Loader)

Source from the content-addressed store, hash-verified

281}
282
283func testFindAllowMatch(t *testing.T, l *Loader) {
284 l.rules["000-allow-chrome"].Precedence = false
285 l.rules["001-deny-chrome"].Action = Allow
286 // test 000-allow-chrome, priority == false
287 // 001-deny-chrome must match
288 match := l.FindFirstMatch(conn)
289 if match == nil {
290 t.Error("FindAllowMatch allow didn't match")
291 }
292 if match.Name != "001-deny-chrome" {
293 t.Error("findAllowMatch: allow rule failed: ", match)
294 }
295}
296
297func testFindEnabled(t *testing.T, l *Loader) {
298 l.rules["000-allow-chrome"].Precedence = false

Callers 1

testFindMatchFunction · 0.85

Calls 1

FindFirstMatchMethod · 0.80

Tested by

no test coverage detected