(t *testing.T)
| 4144 | } |
| 4145 | |
| 4146 | func TestCreateListFlowtable(t *testing.T) { |
| 4147 | c, newNS := nftest.OpenSystemConn(t, *enableSysTests) |
| 4148 | defer nftest.CleanupSystemConn(t, newNS) |
| 4149 | c.FlushRuleset() |
| 4150 | defer c.FlushRuleset() |
| 4151 | |
| 4152 | filter := &nftables.Table{ |
| 4153 | Family: nftables.TableFamilyIPv4, |
| 4154 | Name: "filter", |
| 4155 | } |
| 4156 | |
| 4157 | flowtable := &nftables.Flowtable{ |
| 4158 | Table: filter, |
| 4159 | Name: "flowtable_test", |
| 4160 | } |
| 4161 | |
| 4162 | c.AddTable(filter) |
| 4163 | c.AddFlowtable(flowtable) |
| 4164 | |
| 4165 | if err := c.Flush(); err != nil { |
| 4166 | t.Fatalf("c.Flush() failed: %v", err) |
| 4167 | } |
| 4168 | |
| 4169 | flowtables, err := c.ListFlowtables(filter) |
| 4170 | if err != nil { |
| 4171 | t.Fatalf("c.ListFlowtables() failed: %v", err) |
| 4172 | } |
| 4173 | |
| 4174 | if got, want := len(flowtables), 1; got != want { |
| 4175 | t.Fatalf("flowtable entry length mismatch: got %d, want %d", got, want) |
| 4176 | } |
| 4177 | } |
| 4178 | |
| 4179 | func TestCreateListFlowtableWithDevices(t *testing.T) { |
| 4180 | c, newNS := nftest.OpenSystemConn(t, *enableSysTests) |
nothing calls this directly
no test coverage detected
searching dependent graphs…