Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"detection_time",
"action",
"global/poll_interval",
"pfc_stat_history",
""
],
"operations": ["remove", "add", "replace"],
Expand Down
19 changes: 19 additions & 0 deletions tests/generic_config_updater/field_operation_validator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,25 @@ def test_rdma_config_update_validator_spc_asic_other_field(self):
assert generic_config_updater.field_operation_validators.\
rdma_config_update_validator(scope, patch_element) is False

@patch("sonic_py_common.device_info.get_sonic_version_info",
mock.Mock(return_value={"build_version": "SONiC.20220530"}))
@patch("generic_config_updater.field_operation_validators.get_asic_name",
mock.Mock(return_value="spc1"))
@patch("os.path.exists", mock.Mock(return_value=True))
@patch("builtins.open", mock_open(read_data='''{"tables": {"PFC_WD": {"validator_data": {
"rdma_config_update_validator": {"PFCWD enable/disable": {"fields": [
"restoration_time", "detection_time", "action", "global/poll_interval", "pfc_stat_history"
], "operations": ["remove", "replace", "add"], "platforms": {"spc1": "20181100"}}}}}}}'''))
def test_rdma_config_update_validator_spc_asic_pfc_stat_history(self):
patch_element = {
"path": "/PFC_WD/Ethernet8/pfc_stat_history",
"op": "replace",
"value": "100"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pfc_stat_history options are enable/disable, could you check?

}
for scope in ["localhost", "asic0"]:
assert generic_config_updater.field_operation_validators.\
rdma_config_update_validator(scope, patch_element) is True

@patch("sonic_py_common.device_info.get_sonic_version_info",
mock.Mock(return_value={"build_version": "20250530.12"}))
@patch("generic_config_updater.field_operation_validators.get_asic_name",
Expand Down
Loading