Skip to content

Commit ef0e685

Browse files
committed
add spc2 asic
1 parent 9cecfa2 commit ef0e685

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

generic_config_updater/field_operation_validators.py

+4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ def get_asic_name():
3131
hwsku = output.rstrip('\n')
3232
if asic_type == 'mellanox' or asic_type == 'vs':
3333
spc1_hwskus = asic_mapping["mellanox_asics"]["spc1"]
34+
spc2_hwskus = asic_mapping["mellanox_asics"]["spc2"]
3435
spc3_hwskus = asic_mapping["mellanox_asics"]["spc3"]
3536
if hwsku.lower() in [spc1_hwsku.lower() for spc1_hwsku in spc1_hwskus]:
3637
asic = "spc1"
3738
return asic
39+
if hwsku.lower() in [spc2_hwsku.lower() for spc2_hwsku in spc2_hwskus]:
40+
asic = "spc2"
41+
return asic
3842
if hwsku.lower() in [spc3_hwsku.lower() for spc3_hwsku in spc3_hwskus]:
3943
asic = "spc3"
4044
return asic

generic_config_updater/gcu_field_operation_validators.conf.json

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"rdma_config_update_validator": {
1919
"mellanox_asics": {
2020
"spc1": [ "ACS-MSN2700", "ACS-MSN2740", "ACS-MSN2100", "ACS-MSN2410", "ACS-MSN2010", "Mellanox-SN2700", "Mellanox-SN2700-D48C8" ],
21+
"spc2": [ "ACS-MSN3800", "Mellanox-SN3800-D112C8" ],
2122
"spc3": [ "ACS-MSN4700", "ACS-MSN4600", "ACS-MSN4600C", "ACS-MSN4410", "Mellanox-SN4600C-D112C8", "Mellanox-SN4600C-C64" ]
2223
},
2324
"broadcom_asics": {
@@ -44,6 +45,7 @@
4445
"operations": ["remove", "add", "replace"],
4546
"platforms": {
4647
"spc1": "20181100",
48+
"spc2": "20191100",
4749
"spc3": "20220500",
4850
"td2": "20181100",
4951
"th": "20181100",
@@ -68,6 +70,7 @@
6870
"operations": ["replace"],
6971
"platforms": {
7072
"spc1": "20191100",
73+
"spc2": "20191100",
7174
"spc3": "20220500",
7275
"td2": "",
7376
"th": "20221100",
@@ -90,6 +93,7 @@
9093
"operations": ["replace"],
9194
"platforms": {
9295
"spc1": "20181100",
96+
"spc2": "20191100",
9397
"spc3": "20220500",
9498
"td2": "20181100",
9599
"th": "20181100",
@@ -105,6 +109,7 @@
105109
"operations": ["replace"],
106110
"platforms": {
107111
"spc1": "20191100",
112+
"spc2": "20191100",
108113
"spc3": "20220500",
109114
"td2": "",
110115
"th": "20221100",

tests/generic_config_updater/field_operation_validator_test.py

+8
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ def test_get_asic_spc1(self, mock_popen, mock_get_sonic_version_info):
119119
mock_popen.return_value.communicate.return_value = ["Mellanox-SN2700-D48C8", 0]
120120
self.assertEqual(fov.get_asic_name(), "spc1")
121121

122+
@patch('sonic_py_common.device_info.get_sonic_version_info')
123+
@patch('subprocess.Popen')
124+
def test_get_asic_spc2(self, mock_popen, mock_get_sonic_version_info):
125+
mock_get_sonic_version_info.return_value = {'asic_type': 'mellanox'}
126+
mock_popen.return_value = mock.Mock()
127+
mock_popen.return_value.communicate.return_value = ["ACS-MSN3800", 0]
128+
self.assertEqual(fov.get_asic_name(), "spc2")
129+
122130
@patch('sonic_py_common.device_info.get_sonic_version_info')
123131
@patch('subprocess.Popen')
124132
def test_get_asic_spc3(self, mock_popen, mock_get_sonic_version_info):

0 commit comments

Comments
 (0)