Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[action] [PR:3489] Skip default lanes dup check (#3489) #3533

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading