Skip to content

Commit

Permalink
Skip default lanes dup check (sonic-net#3489)
Browse files Browse the repository at this point in the history
* Add namespace check for multiasic
* Skip Default lane duplication check.
  • Loading branch information
xincunli-sonic committed Aug 16, 2024
1 parent 317e649 commit 1c4300f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generic_config_updater/gu_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ def validate_lanes(self, config_db):
for port in port_to_lanes_map:
lanes = port_to_lanes_map[port]
for lane in lanes:
if lane in existing:
# default lane would be 0, it does not need validate duplication.
if lane in existing and lane != '0':
return False, f"'{lane}' lane is used multiple times in PORT: {set([port, existing[lane]])}"
existing[lane] = port
return True, None
Expand Down
7 changes: 7 additions & 0 deletions tests/generic_config_updater/gu_common_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,13 @@ def test_validate_lanes__same_valid_lanes_multi_ports_no_spaces__failure(self):
}}
self.validate_lanes(config, '67')

def test_validate_lanes_default_value_duplicate_check(self):
config = {"PORT": {
"Ethernet0": {"lanes": "0", "speed": "10000"},
"Ethernet1": {"lanes": "0", "speed": "10000"},
}}
self.validate_lanes(config)

def validate_lanes(self, config_db, expected_error=None):
# Arrange
config_wrapper = gu_common.ConfigWrapper()
Expand Down

0 comments on commit 1c4300f

Please sign in to comment.