@@ -72,62 +72,6 @@ def setUp(self):
72
72
self .config_wrapper_mock = gu_common .ConfigWrapper ()
73
73
self .config_wrapper_mock .get_config_db_as_json = MagicMock (return_value = Files .CONFIG_DB_AS_JSON )
74
74
75
- @patch ("sonic_py_common.device_info.get_sonic_version_info" , mock .Mock (return_value = {"asic_type" : "mellanox" , "build_version" : "SONiC.20181131" }))
76
- def test_validate_field_operation_legal__pfcwd (self ):
77
- old_config = {"PFC_WD" : {"GLOBAL" : {"POLL_INTERVAL" : "60" }}}
78
- target_config = {"PFC_WD" : {"GLOBAL" : {"POLL_INTERVAL" : "40" }}}
79
- config_wrapper = gu_common .ConfigWrapper ()
80
- config_wrapper .validate_field_operation (old_config , target_config )
81
-
82
- def test_validate_field_operation_illegal__pfcwd (self ):
83
- old_config = {"PFC_WD" : {"GLOBAL" : {"POLL_INTERVAL" : "60" }}}
84
- target_config = {"PFC_WD" : {"GLOBAL" : {}}}
85
- config_wrapper = gu_common .ConfigWrapper ()
86
- self .assertRaises (gu_common .IllegalPatchOperationError , config_wrapper .validate_field_operation , old_config , target_config )
87
-
88
- @patch ("sonic_py_common.device_info.get_sonic_version_info" , mock .Mock (return_value = {"build_version" : "SONiC.20181131" }))
89
- @patch ("generic_config_updater.field_operation_validators.get_asic_name" , mock .Mock (return_value = "unknown" ))
90
- def test_validate_field_modification_illegal__pfcwd (self ):
91
- path = "/PFC_WD/GLOBAL/POLL_INTERVAL"
92
- operation = "replace"
93
- assert generic_config_updater .field_operation_validators .rdma_config_update_validator (path , operation ) == False
94
-
95
- def test_validate_field_operation_legal__rm_loopback1 (self ):
96
- old_config = {
97
- "LOOPBACK_INTERFACE" : {
98
- "Loopback0" : {},
99
- "Loopback0|10.1.0.32/32" : {},
100
- "Loopback1" : {},
101
- "Loopback1|10.1.0.33/32" : {}
102
- }
103
- }
104
- target_config = {
105
- "LOOPBACK_INTERFACE" : {
106
- "Loopback0" : {},
107
- "Loopback0|10.1.0.32/32" : {}
108
- }
109
- }
110
- config_wrapper = gu_common .ConfigWrapper ()
111
- config_wrapper .validate_field_operation (old_config , target_config )
112
-
113
- def test_validate_field_operation_illegal__rm_loopback0 (self ):
114
- old_config = {
115
- "LOOPBACK_INTERFACE" : {
116
- "Loopback0" : {},
117
- "Loopback0|10.1.0.32/32" : {},
118
- "Loopback1" : {},
119
- "Loopback1|10.1.0.33/32" : {}
120
- }
121
- }
122
- target_config = {
123
- "LOOPBACK_INTERFACE" : {
124
- "Loopback1" : {},
125
- "Loopback1|10.1.0.33/32" : {}
126
- }
127
- }
128
- config_wrapper = gu_common .ConfigWrapper ()
129
- self .assertRaises (gu_common .IllegalPatchOperationError , config_wrapper .validate_field_operation , old_config , target_config )
130
-
131
75
def test_ctor__default_values_set (self ):
132
76
config_wrapper = gu_common .ConfigWrapper ()
133
77
0 commit comments