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

Function TestScriptAction_DeleteItem

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

Source from the content-addressed store, hash-verified

32}
33
34func 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}

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected