[#356] netmap: Check for attribute duplicates in NodeInfo.readFromV2()

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2025-04-05 10:31:05 +03:00 committed by Evgenii Stratonikov
parent 684050b570
commit 88bc9eeb26
2 changed files with 1 additions and 1 deletions

View file

@ -52,6 +52,7 @@ func (x *NodeInfo) readFromV2(m netmap.NodeInfo, checkFieldPresence bool) error
} else if _, ok := mAttr[key]; ok {
return fmt.Errorf("duplicate attributes %s", key)
}
mAttr[key] = struct{}{}
switch {
case key == attrCapacity:

View file

@ -271,7 +271,6 @@ func TestNodeInfo_Unmarshal(t *testing.T) {
fmt.Sprintf("invalid %s attribute", attrCapacity))
})
t.Run("duplicate attributes", func(t *testing.T) {
t.Skip("FIXME")
n := goodNodeInfo()
var a netmap.Attribute