Skip to content
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
4 changes: 4 additions & 0 deletions generic_config_updater/field_operation_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def get_asic_name():
spc1_hwskus = asic_mapping["mellanox_asics"]["spc1"]
spc2_hwskus = asic_mapping["mellanox_asics"]["spc2"]
spc3_hwskus = asic_mapping["mellanox_asics"]["spc3"]
spc4_hwskus = asic_mapping["mellanox_asics"]["spc4"]
if hwsku.lower() in [spc1_hwsku.lower() for spc1_hwsku in spc1_hwskus]:
asic = "spc1"
return asic
Expand All @@ -43,6 +44,9 @@ def get_asic_name():
if hwsku.lower() in [spc3_hwsku.lower() for spc3_hwsku in spc3_hwskus]:
asic = "spc3"
return asic
if hwsku.lower() in [spc4_hwsku.lower() for spc4_hwsku in spc4_hwskus]:
asic = "spc4"
return asic
if asic_type == 'broadcom' or asic_type == 'vs':
broadcom_asics = asic_mapping["broadcom_asics"]
for asic_shorthand, hwskus in broadcom_asics.items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"mellanox_asics": {
"spc1": [ "ACS-MSN2700", "ACS-MSN2740", "ACS-MSN2100", "ACS-MSN2410", "ACS-MSN2010", "Mellanox-SN2700", "Mellanox-SN2700-D48C8" ],
"spc2": [ "ACS-MSN3800", "Mellanox-SN3800-D112C8" ],
"spc3": [ "ACS-MSN4700", "ACS-MSN4600", "ACS-MSN4600C", "ACS-MSN4410", "Mellanox-SN4600C-D112C8", "Mellanox-SN4600C-C64", "Mellanox-SN4700-O8C48" ]
"spc3": [ "ACS-MSN4700", "ACS-MSN4600", "ACS-MSN4600C", "ACS-MSN4410", "Mellanox-SN4600C-D112C8", "Mellanox-SN4600C-C64", "Mellanox-SN4700-O8C48" ],
"spc4": [ "ACS-SN5600"]
},
"broadcom_asics": {
"th": [ "Force10-S6100", "Arista-7060CX-32S-C32", "Arista-7060CX-32S-C32-T1", "Arista-7060CX-32S-D48C8", "Celestica-DX010-C32", "Seastone-DX010" ],
Expand Down Expand Up @@ -47,6 +48,7 @@
"spc1": "20181100",
"spc2": "20191100",
"spc3": "20220500",
"spc4": "20221100",
"td2": "20181100",
"th": "20181100",
"th2": "20181100",
Expand All @@ -72,6 +74,7 @@
"spc1": "20191100",
"spc2": "20191100",
"spc3": "20220500",
"spc4": "20221100",
"td2": "",
"th": "20221100",
"th2": "20221100",
Expand All @@ -95,6 +98,7 @@
"spc1": "20181100",
"spc2": "20191100",
"spc3": "20220500",
"spc4": "20221100",
"td2": "20181100",
"th": "20181100",
"th2": "20181100",
Expand All @@ -111,6 +115,7 @@
"spc1": "20191100",
"spc2": "20191100",
"spc3": "20220500",
"spc4": "20221100",
"td2": "",
"th": "20221100",
"th2": "20221100",
Expand All @@ -136,6 +141,7 @@
"spc1": "20181100",
"spc2": "20191100",
"spc3": "20220500",
"spc4": "20221100",
"td2": "20181100",
"th": "20181100",
"th2": "20181100",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ def test_get_asic_spc3(self, mock_popen, mock_get_sonic_version_info):
mock_popen.return_value.communicate.return_value = ["Mellanox-SN4600C-C64", 0]
self.assertEqual(fov.get_asic_name(), "spc3")

@patch('sonic_py_common.device_info.get_sonic_version_info')
@patch('subprocess.Popen')
def test_get_asic_spc4(self, mock_popen, mock_get_sonic_version_info):
mock_get_sonic_version_info.return_value = {'asic_type': 'mellanox'}
mock_popen.return_value = mock.Mock()
mock_popen.return_value.communicate.return_value = ["ACS-SN5600", 0]
self.assertEqual(fov.get_asic_name(), "spc4")

@patch('sonic_py_common.device_info.get_sonic_version_info')
@patch('subprocess.Popen')
def test_get_asic_th(self, mock_popen, mock_get_sonic_version_info):
Expand Down