diff --git a/generic_config_updater/field_operation_validators.py b/generic_config_updater/field_operation_validators.py index fc7c14464e..1aae399ade 100644 --- a/generic_config_updater/field_operation_validators.py +++ b/generic_config_updater/field_operation_validators.py @@ -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 @@ -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(): diff --git a/generic_config_updater/gcu_field_operation_validators.conf.json b/generic_config_updater/gcu_field_operation_validators.conf.json index 4398f96abd..50d3ebb478 100644 --- a/generic_config_updater/gcu_field_operation_validators.conf.json +++ b/generic_config_updater/gcu_field_operation_validators.conf.json @@ -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" ], @@ -47,6 +48,7 @@ "spc1": "20181100", "spc2": "20191100", "spc3": "20220500", + "spc4": "20221100", "td2": "20181100", "th": "20181100", "th2": "20181100", @@ -72,6 +74,7 @@ "spc1": "20191100", "spc2": "20191100", "spc3": "20220500", + "spc4": "20221100", "td2": "", "th": "20221100", "th2": "20221100", @@ -95,6 +98,7 @@ "spc1": "20181100", "spc2": "20191100", "spc3": "20220500", + "spc4": "20221100", "td2": "20181100", "th": "20181100", "th2": "20181100", @@ -111,6 +115,7 @@ "spc1": "20191100", "spc2": "20191100", "spc3": "20220500", + "spc4": "20221100", "td2": "", "th": "20221100", "th2": "20221100", @@ -136,6 +141,7 @@ "spc1": "20181100", "spc2": "20191100", "spc3": "20220500", + "spc4": "20221100", "td2": "20181100", "th": "20181100", "th2": "20181100", diff --git a/tests/generic_config_updater/field_operation_validator_test.py b/tests/generic_config_updater/field_operation_validator_test.py index f69955fc28..8874a4026d 100644 --- a/tests/generic_config_updater/field_operation_validator_test.py +++ b/tests/generic_config_updater/field_operation_validator_test.py @@ -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):