(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestScriptAction_AddItem(t *testing.T) { |
| 12 | if !testutils.IsSingleTesting() { |
| 13 | return |
| 14 | } |
| 15 | |
| 16 | action := NewScriptAction() |
| 17 | action.config = &firewallconfigs.FirewallActionScriptConfig{ |
| 18 | Path: "/tmp/ip-item.sh", |
| 19 | Cwd: "", |
| 20 | Args: nil, |
| 21 | } |
| 22 | err := action.AddItem(IPListTypeBlack, &pb.IPItem{ |
| 23 | Type: "ipv4", |
| 24 | Id: 1, |
| 25 | IpFrom: "192.168.1.100", |
| 26 | ExpiredAt: time.Now().Unix(), |
| 27 | }) |
| 28 | if err != nil { |
| 29 | t.Fatal(err) |
| 30 | } |
| 31 | t.Log("ok") |
| 32 | } |
| 33 | |
| 34 | func TestScriptAction_DeleteItem(t *testing.T) { |
| 35 | if !testutils.IsSingleTesting() { |
nothing calls this directly
no test coverage detected