Skip to content

Commit bacff45

Browse files
Add Arista 7800 platforms to GCU validator (sonic-net#4030)
1 parent c63e9ea commit bacff45

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

generic_config_updater/field_operation_validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
def get_asic_name():
1919
asic = "unknown"
20-
20+
2121
if os.path.exists(GCU_TABLE_MOD_CONF_FILE):
2222
with open(GCU_TABLE_MOD_CONF_FILE, "r") as s:
2323
gcu_field_operation_conf = json.load(s)
2424
else:
2525
raise GenericConfigUpdaterError("GCU table modification validators config file not found")
26-
26+
2727
asic_mapping = gcu_field_operation_conf["helper_data"]["rdma_config_update_validator"]
2828
asic_type = device_info.get_sonic_version_info()['asic_type']
2929

generic_config_updater/gcu_field_operation_validators.conf.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"td3": [ "Arista-7050CX3-32C-C32", "Arista-7050CX3-32S-C32", "Arista-7050CX3-32S-D48C8", "Arista-7050CX3-32S-C28S4" ],
3737
"td4": [ "Nokia-IXR7220-D4-36D" ],
3838
"j2c+": [ "Nokia-IXR7250E-36x100G", "Nokia-IXR7250E-36x400G", "Nokia-IXR7250-X3B" ],
39-
"q2c+": [ "Nokia-IXR7250-X1B" ]
39+
"q2c+": [ "Nokia-IXR7250-X1B" ],
40+
"jr2": [ "Arista-7800R3-48CQ2-C48", "Arista-7800R3-48CQM2-C48" ]
4041
}
4142
}
4243
},
@@ -56,7 +57,7 @@
5657
"operations": ["remove", "add", "replace"],
5758
"platforms": {
5859
"spc1": "20181100",
59-
"spc2": "20191100",
60+
"spc2": "20191100",
6061
"spc3": "20220500",
6162
"spc4": "20221100",
6263
"spc5": "20241200",
@@ -90,7 +91,7 @@
9091
"operations": ["replace"],
9192
"platforms": {
9293
"spc1": "20191100",
93-
"spc2": "20191100",
94+
"spc2": "20191100",
9495
"spc3": "20220500",
9596
"spc4": "20221100",
9697
"spc5": "20241200",
@@ -121,7 +122,7 @@
121122
"operations": ["replace"],
122123
"platforms": {
123124
"spc1": "20181100",
124-
"spc2": "20191100",
125+
"spc2": "20191100",
125126
"spc3": "20220500",
126127
"spc4": "20221100",
127128
"spc5": "20241200",
@@ -146,7 +147,7 @@
146147
"operations": ["replace"],
147148
"platforms": {
148149
"spc1": "20191100",
149-
"spc2": "20191100",
150+
"spc2": "20191100",
150151
"spc3": "20220500",
151152
"spc4": "20221100",
152153
"spc5": "20241200",

tests/generic_config_updater/field_operation_validator_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,15 @@ def test_get_asic_j2cplus(self, mock_popen, mock_get_sonic_version_info):
608608
for scope in ["localhost", "asic0"]:
609609
self.assertEqual(fov.get_asic_name(), "j2c+")
610610

611+
@patch('sonic_py_common.device_info.get_sonic_version_info')
612+
@patch('subprocess.Popen')
613+
def test_get_asic_jr2(self, mock_popen, mock_get_sonic_version_info):
614+
mock_get_sonic_version_info.return_value = {'asic_type': 'broadcom'}
615+
mock_popen.return_value = mock.Mock()
616+
mock_popen.return_value.communicate.return_value = ["Arista-7800R3-48CQ2-C48", 0]
617+
for scope in ["localhost", "asic0"]:
618+
self.assertEqual(fov.get_asic_name(), "jr2")
619+
611620
@patch('sonic_py_common.device_info.get_sonic_version_info')
612621
@patch('subprocess.Popen')
613622
def test_get_asic_q2cplus(self, mock_popen, mock_get_sonic_version_info):

0 commit comments

Comments
 (0)