(t *testing.T)
| 32 | } |
| 33 | |
| 34 | func TestScriptAction_DeleteItem(t *testing.T) { |
| 35 | if !testutils.IsSingleTesting() { |
| 36 | return |
| 37 | } |
| 38 | |
| 39 | action := NewScriptAction() |
| 40 | action.config = &firewallconfigs.FirewallActionScriptConfig{ |
| 41 | Path: "/tmp/ip-item.sh", |
| 42 | Cwd: "", |
| 43 | Args: nil, |
| 44 | } |
| 45 | err := action.DeleteItem(IPListTypeBlack, &pb.IPItem{ |
| 46 | Type: "ipv4", |
| 47 | Id: 1, |
| 48 | IpFrom: "192.168.1.100", |
| 49 | ExpiredAt: time.Now().Unix(), |
| 50 | }) |
| 51 | if err != nil { |
| 52 | t.Fatal(err) |
| 53 | } |
| 54 | t.Log("ok") |
| 55 | } |
nothing calls this directly
no test coverage detected