Skip to content

Commit

Permalink
remove duplicate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelmsft committed Apr 19, 2023
1 parent c367995 commit ceecb48
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions tests/generic_config_updater/gu_common_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,62 +72,6 @@ def setUp(self):
self.config_wrapper_mock = gu_common.ConfigWrapper()
self.config_wrapper_mock.get_config_db_as_json=MagicMock(return_value=Files.CONFIG_DB_AS_JSON)

@patch("sonic_py_common.device_info.get_sonic_version_info", mock.Mock(return_value={"asic_type": "mellanox", "build_version": "SONiC.20181131"}))
def test_validate_field_operation_legal__pfcwd(self):
old_config = {"PFC_WD": {"GLOBAL": {"POLL_INTERVAL": "60"}}}
target_config = {"PFC_WD": {"GLOBAL": {"POLL_INTERVAL": "40"}}}
config_wrapper = gu_common.ConfigWrapper()
config_wrapper.validate_field_operation(old_config, target_config)

def test_validate_field_operation_illegal__pfcwd(self):
old_config = {"PFC_WD": {"GLOBAL": {"POLL_INTERVAL": "60"}}}
target_config = {"PFC_WD": {"GLOBAL": {}}}
config_wrapper = gu_common.ConfigWrapper()
self.assertRaises(gu_common.IllegalPatchOperationError, config_wrapper.validate_field_operation, old_config, target_config)

@patch("sonic_py_common.device_info.get_sonic_version_info", mock.Mock(return_value={"build_version": "SONiC.20181131"}))
@patch("generic_config_updater.field_operation_validators.get_asic_name", mock.Mock(return_value="unknown"))
def test_validate_field_modification_illegal__pfcwd(self):
path = "/PFC_WD/GLOBAL/POLL_INTERVAL"
operation = "replace"
assert generic_config_updater.field_operation_validators.rdma_config_update_validator(path, operation) == False

def test_validate_field_operation_legal__rm_loopback1(self):
old_config = {
"LOOPBACK_INTERFACE": {
"Loopback0": {},
"Loopback0|10.1.0.32/32": {},
"Loopback1": {},
"Loopback1|10.1.0.33/32": {}
}
}
target_config = {
"LOOPBACK_INTERFACE": {
"Loopback0": {},
"Loopback0|10.1.0.32/32": {}
}
}
config_wrapper = gu_common.ConfigWrapper()
config_wrapper.validate_field_operation(old_config, target_config)

def test_validate_field_operation_illegal__rm_loopback0(self):
old_config = {
"LOOPBACK_INTERFACE": {
"Loopback0": {},
"Loopback0|10.1.0.32/32": {},
"Loopback1": {},
"Loopback1|10.1.0.33/32": {}
}
}
target_config = {
"LOOPBACK_INTERFACE": {
"Loopback1": {},
"Loopback1|10.1.0.33/32": {}
}
}
config_wrapper = gu_common.ConfigWrapper()
self.assertRaises(gu_common.IllegalPatchOperationError, config_wrapper.validate_field_operation, old_config, target_config)

def test_ctor__default_values_set(self):
config_wrapper = gu_common.ConfigWrapper()

Expand Down

0 comments on commit ceecb48

Please sign in to comment.