Skip to content

Commit

Permalink
updated operator and loader tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-iniguez-goya committed Feb 27, 2021
1 parent 44e8561 commit 1d277ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions daemon/rule/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestRuleLoader(t *testing.T) {
var list []Operator
dur1s := Duration("1s")
dummyOper, _ := NewOperator(Simple, false, OpTrue, "", list)
dummyOper.Compile()
inMem1sRule := Create("000-xxx-name", true, false, Allow, dur1s, dummyOper)
inMemUntilRestartRule := Create("000-aaa-name", true, false, Allow, Restart, dummyOper)

Expand Down
4 changes: 4 additions & 0 deletions daemon/rule/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ func TestNewOperatorSimple(t *testing.T) {
t.Error("NewOperator simple.dstHost.sensitive err should be nil: ", err)
t.Fail()
}
if err = opSimple.Compile(); err != nil {
t.Error("NewOperator simple.dstHost.sensitive Compile() err:", err)
t.Fail()
}
conn.DstHost = "OpEnsNitCh.io"
if opSimple.Match(conn) == false {
t.Error("Test NewOperator() simple.dstHost.sensitive doesn't match")
Expand Down

0 comments on commit 1d277ef

Please sign in to comment.