add vmap tests

This commit is contained in:
Nikita Vorontsov 2025-07-14 10:20:15 +03:00
parent 879036fb19
commit 10e3e381ed
1 changed files with 24 additions and 0 deletions

View File

@ -240,6 +240,30 @@ func TestMarshalSet(t *testing.T) {
Timeout: 30 * time.Second,
},
},
{
name: "Map ip-ip", // generic case
set: Set{
Name: "test-map",
ID: uint32(3),
Table: tbl,
KeyType: TypeIPAddr,
DataType: TypeIPAddr,
IsMap: true,
},
},
{
// special case, see
// sets.go:setsFromMsg:(case unix.NFTA_SET_DATA_TYPE) and sets.go:AddSet:(if s.DataType.nftMagic == 1)
name: "Vedict map",
set: Set{
Name: "test-map",
ID: uint32(3),
Table: tbl,
KeyType: TypeIPAddr,
DataType: TypeVerdict,
IsMap: true,
},
},
}
for i, tt := range tests {