MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / TestScriptAction_AddItem

Function TestScriptAction_AddItem

internal/iplibrary/action_script_test.go:11–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func 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
34func TestScriptAction_DeleteItem(t *testing.T) {
35 if !testutils.IsSingleTesting() {

Callers

nothing calls this directly

Calls 5

AddItemMethod · 0.95
IsSingleTestingFunction · 0.92
NewScriptActionFunction · 0.85
UnixMethod · 0.80
LogMethod · 0.80

Tested by

no test coverage detected