MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestTable_AddChain

Function TestTable_AddChain

internal/firewalls/nftables/table_test.go:30–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestTable_AddChain(t *testing.T) {
31 var table = getIPv4Table(t)
32
33 {
34 chain, err := table.AddChain("test_default_chain", nil)
35 if err != nil {
36 t.Fatal(err)
37 }
38 t.Log("created:", chain.Name())
39 }
40
41 {
42 chain, err := table.AddAcceptChain("test_accept_chain")
43 if err != nil {
44 t.Fatal(err)
45 }
46 t.Log("created:", chain.Name())
47 }
48
49 // Do not test drop chain before adding accept rule, you will drop yourself!!!!!!!
50 /**{
51 chain, err := table.AddDropChain("test_drop_chain")
52 if err != nil {
53 t.Fatal(err)
54 }
55 t.Log("created:", chain.Name())
56 }**/
57}
58
59func TestTable_GetChain(t *testing.T) {
60 var table = getIPv4Table(t)

Callers

nothing calls this directly

Calls 5

getIPv4TableFunction · 0.85
AddChainMethod · 0.80
LogMethod · 0.80
AddAcceptChainMethod · 0.80
NameMethod · 0.65

Tested by

no test coverage detected