(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestHTTPAPIAction_AddItem(t *testing.T) { |
| 11 | if !testutils.IsSingleTesting() { |
| 12 | return |
| 13 | } |
| 14 | |
| 15 | var action = NewHTTPAPIAction() |
| 16 | action.config = &firewallconfigs.FirewallActionHTTPAPIConfig{ |
| 17 | URL: "http://127.0.0.1:2345/post", |
| 18 | TimeoutSeconds: 0, |
| 19 | } |
| 20 | err := action.AddItem(IPListTypeBlack, &pb.IPItem{ |
| 21 | Type: "ipv4", |
| 22 | Id: 1, |
| 23 | IpFrom: "192.168.1.100", |
| 24 | }) |
| 25 | if err != nil { |
| 26 | t.Fatal(err) |
| 27 | } |
| 28 | t.Log("ok") |
| 29 | } |
| 30 | |
| 31 | func TestHTTPAPIAction_DeleteItem(t *testing.T) { |
| 32 | if !testutils.IsSingleTesting() { |
nothing calls this directly
no test coverage detected