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

Function TestTable_AddSet

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

Source from the content-addressed store, hash-verified

82}
83
84func TestTable_AddSet(t *testing.T) {
85 var table = getIPv4Table(t)
86 {
87 set, err := table.AddSet("ipv4_black_set", &nftables.SetOptions{
88 HasTimeout: false,
89 KeyType: nftables.TypeIPAddr,
90 })
91 if err != nil {
92 t.Fatal(err)
93 }
94 t.Log(set.Name())
95 }
96
97 {
98 set, err := table.AddSet("ipv6_black_set", &nftables.SetOptions{
99 HasTimeout: true,
100 //Timeout: 3600 * time.Second,
101 KeyType: nftables.TypeIP6Addr,
102 })
103 if err != nil {
104 t.Fatal(err)
105 }
106 t.Log(set.Name())
107 }
108}
109
110func TestTable_GetSet(t *testing.T) {
111 var table = getIPv4Table(t)

Callers

nothing calls this directly

Calls 4

getIPv4TableFunction · 0.85
AddSetMethod · 0.80
LogMethod · 0.80
NameMethod · 0.65

Tested by

no test coverage detected