(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestIPList_ContainsExpires(t *testing.T) { |
| 76 | var list = waf.NewIPList(waf.IPListTypeDeny) |
| 77 | |
| 78 | for i := 0; i < 1_0000; i++ { |
| 79 | list.Add(waf.IPTypeAll, firewallconfigs.FirewallScopeGlobal, 1, "192.168.1."+strconv.Itoa(i), time.Now().Unix()+3600) |
| 80 | } |
| 81 | // list.RemoveIP("192.168.1.100", 1, false) |
| 82 | for _, ip := range []string{"192.168.1.100", "192.168.2.100"} { |
| 83 | expiresAt, ok := list.ContainsExpires(waf.IPTypeAll, firewallconfigs.FirewallScopeGlobal, 1, ip) |
| 84 | t.Log(ok, expiresAt, timeutil.FormatTime("Y-m-d H:i:s", expiresAt)) |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | func TestIPList_Save(t *testing.T) { |
| 89 | var a = assert.NewAssertion(t) |
nothing calls this directly
no test coverage detected