@@ -31,9 +31,17 @@ def test_rdma_config_update_validator_td3_asic_invalid_version(self):
31
31
@patch ("generic_config_updater.field_operation_validators.get_asic_name" , mock .Mock (return_value = "spc1" ))
32
32
@patch ("os.path.exists" , mock .Mock (return_value = True ))
33
33
@patch ("builtins.open" , mock_open (read_data = '{"tables": {"PFC_WD": {"validator_data": {"rdma_config_update_validator": {"PFCWD enable/disable": {"fields": ["detection_time", "action"], "operations": ["remove", "replace", "add"], "platforms": {"spc1": "20181100"}}}}}}}' ))
34
- def test_rdma_config_update_validator_spc_asic_valid_version (self ):
34
+ def test_rdma_config_update_validator_spc_asic_valid_version_remove (self ):
35
35
patch_element = {"path" : "/PFC_WD/Ethernet8/detection_time" , "op" : "remove" }
36
36
assert generic_config_updater .field_operation_validators .rdma_config_update_validator (patch_element ) == True
37
+
38
+ @patch ("sonic_py_common.device_info.get_sonic_version_info" , mock .Mock (return_value = {"build_version" : "SONiC.20220530" }))
39
+ @patch ("generic_config_updater.field_operation_validators.get_asic_name" , mock .Mock (return_value = "spc1" ))
40
+ @patch ("os.path.exists" , mock .Mock (return_value = True ))
41
+ @patch ("builtins.open" , mock_open (read_data = '{"tables": {"PFC_WD": {"validator_data": {"rdma_config_update_validator": {"PFCWD enable/disable": {"fields": ["detection_time", "restoration_time", "action"], "operations": ["remove", "replace", "add"], "platforms": {"spc1": "20181100"}}}}}}}' ))
42
+ def test_rdma_config_update_validator_spc_asic_valid_version_add_pfcwd (self ):
43
+ patch_element = {"path" : "/PFC_WD/Ethernet8" , "op" : "add" , "value" : {"action" : "drop" , "detection_time" : "300" , "restoration_time" : "200" }}
44
+ assert generic_config_updater .field_operation_validators .rdma_config_update_validator (patch_element ) == True
37
45
38
46
@patch ("sonic_py_common.device_info.get_sonic_version_info" , mock .Mock (return_value = {"build_version" : "SONiC.20220530" }))
39
47
@patch ("generic_config_updater.field_operation_validators.get_asic_name" , mock .Mock (return_value = "spc1" ))
0 commit comments