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

Function testSortRules

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

Source from the content-addressed store, hash-verified

234}
235
236func testSortRules(t *testing.T, l *Loader) {
237 l.activeRules[1] = "001-deny-chrome"
238 l.activeRules[2] = "000-allow-chrome"
239 l.sortRules()
240 if l.activeRules[1] != "000-allow-chrome" {
241 t.Error("Rules not in order (1): ", l.activeRules)
242 }
243 if l.activeRules[2] != "001-deny-chrome" {
244 t.Error("Rules not in order (2): ", l.activeRules)
245 }
246}
247
248func testFindMatch(t *testing.T, l *Loader) {
249 conn.Process.Path = "/opt/google/chrome/chrome"

Callers 1

TestRuleLoaderFunction · 0.85

Calls 1

sortRulesMethod · 0.80

Tested by

no test coverage detected