Skip to content

Commit

Permalink
Remove GCU unique lane check
Browse files Browse the repository at this point in the history
  • Loading branch information
wen587 committed Aug 31, 2022
1 parent f0ce586 commit 72b8249
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 350 deletions.
17 changes: 9 additions & 8 deletions generic_config_updater/gu_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,15 @@ def validate_lanes(self, config_db):
return False, f"PORT '{port}' has an invalid lane '{lane}'"
port_to_lanes_map[port] = lanes

# Validate lanes are unique
existing = {}
for port in port_to_lanes_map:
lanes = port_to_lanes_map[port]
for lane in lanes:
if lane in existing:
return False, f"'{lane}' lane is used multiple times in PORT: {set([port, existing[lane]])}"
existing[lane] = port
#TODO: uncomment dup lane check
## Validate lanes are unique
#existing = {}
#for port in port_to_lanes_map:
# lanes = port_to_lanes_map[port]
# for lane in lanes:
# if lane in existing:
# return False, f"'{lane}' lane is used multiple times in PORT: {set([port, existing[lane]])}"
# existing[lane] = port
return True, None

def validate_bgp_peer_group(self, config_db):
Expand Down
326 changes: 1 addition & 325 deletions tests/generic_config_updater/files/patch_sorter_test_success.json
Original file line number Diff line number Diff line change
Expand Up @@ -656,330 +656,6 @@
]
]
},
"DPB_1_TO_4__SUCCESS": {
"desc": "Dpb 1 to 4 success.",
"current_config": {
"PORT": {
"Ethernet0": {
"alias": "Eth1",
"lanes": "65, 66, 67, 68",
"description": "Ethernet0 100G link",
"speed": "100000"
}
},
"ACL_TABLE": {
"NO-NSW-PACL-V4": {
"type": "L3",
"policy_desc": "NO-NSW-PACL-V4",
"ports": [
"Ethernet0"
]
}
},
"VLAN_MEMBER": {
"Vlan100|Ethernet0": {
"tagging_mode": "untagged"
}
},
"VLAN": {
"Vlan100": {
"vlanid": "100",
"dhcp_servers": [
"192.0.0.1",
"192.0.0.2",
"192.0.0.3",
"192.0.0.4"
]
}
}
},
"patch": [
{
"op": "add",
"path": "/VLAN_MEMBER/Vlan100|Ethernet1",
"value": {
"tagging_mode": "untagged"
}
},
{
"op": "add",
"path": "/VLAN_MEMBER/Vlan100|Ethernet3",
"value": {
"tagging_mode": "untagged"
}
},
{
"op": "add",
"path": "/VLAN_MEMBER/Vlan100|Ethernet2",
"value": {
"tagging_mode": "untagged"
}
},
{
"op": "add",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/ports/1",
"value": "Ethernet1"
},
{
"op": "add",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/ports/2",
"value": "Ethernet2"
},
{
"op": "add",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/ports/3",
"value": "Ethernet3"
},
{
"op": "add",
"path": "/PORT/Ethernet3",
"value": {
"alias": "Eth1/4",
"lanes": "68",
"description": "",
"speed": "10000"
}
},
{
"op": "add",
"path": "/PORT/Ethernet2",
"value": {
"alias": "Eth1/3",
"lanes": "67",
"description": "",
"speed": "10000"
}
},
{
"op": "add",
"path": "/PORT/Ethernet1",
"value": {
"alias": "Eth1/2",
"lanes": "66",
"description": "",
"speed": "10000"
}
},
{
"op": "replace",
"path": "/PORT/Ethernet0/alias",
"value": "Eth1/1"
},
{
"op": "replace",
"path": "/PORT/Ethernet0/description",
"value": ""
},
{
"op": "replace",
"path": "/PORT/Ethernet0/lanes",
"value": "65"
},
{
"op": "replace",
"path": "/PORT/Ethernet0/speed",
"value": "10000"
}
],
"expected_changes": [
[
{
"op": "replace",
"path": "/PORT/Ethernet0/alias",
"value": "Eth1/1"
}
],
[
{
"op": "replace",
"path": "/PORT/Ethernet0/description",
"value": ""
}
],
[
{
"op": "replace",
"path": "/PORT/Ethernet0/speed",
"value": "10000"
}
],
[
{
"op": "remove",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/ports"
}
],
[
{
"op": "remove",
"path": "/ACL_TABLE"
}
],
[
{
"op": "add",
"path": "/ACL_TABLE",
"value": {
"NO-NSW-PACL-V4": {
"type": "L3"
}
}
}
],
[
{
"op": "add",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/ports",
"value": [
"Ethernet0"
]
}
],
[
{
"op": "remove",
"path": "/VLAN_MEMBER"
}
],
[
{
"op": "add",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/policy_desc",
"value": "NO-NSW-PACL-V4"
}
],
[
{
"op": "remove",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/ports"
}
],
[
{
"op": "remove",
"path": "/PORT"
}
],
[
{
"op": "add",
"path": "/PORT",
"value": {
"Ethernet0": {
"alias": "Eth1/1",
"lanes": "65",
"description": "",
"speed": "10000"
}
}
}
],
[
{
"op": "add",
"path": "/PORT/Ethernet3",
"value": {
"alias": "Eth1/4",
"lanes": "68",
"description": "",
"speed": "10000"
}
}
],
[
{
"op": "add",
"path": "/PORT/Ethernet2",
"value": {
"alias": "Eth1/3",
"lanes": "67",
"description": "",
"speed": "10000"
}
}
],
[
{
"op": "add",
"path": "/PORT/Ethernet1",
"value": {
"alias": "Eth1/2",
"lanes": "66",
"description": "",
"speed": "10000"
}
}
],
[
{
"op": "add",
"path": "/VLAN_MEMBER",
"value": {
"Vlan100|Ethernet0": {
"tagging_mode": "untagged"
}
}
}
],
[
{
"op": "add",
"path": "/VLAN_MEMBER/Vlan100|Ethernet1",
"value": {
"tagging_mode": "untagged"
}
}
],
[
{
"op": "add",
"path": "/VLAN_MEMBER/Vlan100|Ethernet3",
"value": {
"tagging_mode": "untagged"
}
}
],
[
{
"op": "add",
"path": "/VLAN_MEMBER/Vlan100|Ethernet2",
"value": {
"tagging_mode": "untagged"
}
}
],
[
{
"op": "add",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/ports",
"value": [
"Ethernet0"
]
}
],
[
{
"op": "add",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/ports/1",
"value": "Ethernet1"
}
],
[
{
"op": "add",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/ports/2",
"value": "Ethernet2"
}
],
[
{
"op": "add",
"path": "/ACL_TABLE/NO-NSW-PACL-V4/ports/3",
"value": "Ethernet3"
}
]
]
},
"DPB_4_TO_1__SUCCESS": {
"desc": "Dpb 4 to 1 success.",
"current_config": {
Expand Down Expand Up @@ -6157,4 +5833,4 @@
]
]
}
}
}
Loading

0 comments on commit 72b8249

Please sign in to comment.