@@ -69,18 +69,54 @@ def setUp(self):
69
69
self .config_wrapper_mock = gu_common .ConfigWrapper ()
70
70
self .config_wrapper_mock .get_config_db_as_json = MagicMock (return_value = Files .CONFIG_DB_AS_JSON )
71
71
72
- def test_validate_field_operation_legal (self ):
72
+ def test_validate_field_operation_legal__pfcwd (self ):
73
73
old_config = {"PFC_WD" : {"GLOBAL" : {"POLL_INTERVAL" : "60" }}}
74
74
target_config = {"PFC_WD" : {"GLOBAL" : {"POLL_INTERVAL" : "40" }}}
75
75
config_wrapper = gu_common .ConfigWrapper ()
76
76
config_wrapper .validate_field_operation (old_config , target_config )
77
-
78
- def test_validate_field_operation_illegal (self ):
77
+
78
+ def test_validate_field_operation_legal__loopback0 (self ):
79
+ old_config = {
80
+ "LOOPBACK_INTERFACE" : {
81
+ "Loopback0" : {},
82
+ "Loopback0|10.1.0.32/32" : {},
83
+ "Loopback1" : {},
84
+ "Loopback1|10.1.0.33/32" : {}
85
+ }
86
+ }
87
+ target_config = {
88
+ "LOOPBACK_INTERFACE" : {
89
+ "Loopback0" : {},
90
+ "Loopback0|10.1.0.32/32" : {}
91
+ }
92
+ }
93
+ config_wrapper = gu_common .ConfigWrapper ()
94
+ config_wrapper .validate_field_operation (old_config , target_config )
95
+
96
+ def test_validate_field_operation_illegal__pfcwd (self ):
79
97
old_config = {"PFC_WD" : {"GLOBAL" : {"POLL_INTERVAL" : 60 }}}
80
98
target_config = {"PFC_WD" : {"GLOBAL" : {}}}
81
99
config_wrapper = gu_common .ConfigWrapper ()
82
100
self .assertRaises (gu_common .IllegalPatchOperationError , config_wrapper .validate_field_operation , old_config , target_config )
83
101
102
+ def test_validate_field_operation_illegal__loopback0 (self ):
103
+ old_config = {
104
+ "LOOPBACK_INTERFACE" : {
105
+ "Loopback0" : {},
106
+ "Loopback0|10.1.0.32/32" : {},
107
+ "Loopback1" : {},
108
+ "Loopback1|10.1.0.33/32" : {}
109
+ }
110
+ }
111
+ target_config = {
112
+ "LOOPBACK_INTERFACE" : {
113
+ "Loopback1" : {},
114
+ "Loopback1|10.1.0.33/32" : {}
115
+ }
116
+ }
117
+ config_wrapper = gu_common .ConfigWrapper ()
118
+ self .assertRaises (gu_common .IllegalPatchOperationError , config_wrapper .validate_field_operation , old_config , target_config )
119
+
84
120
def test_ctor__default_values_set (self ):
85
121
config_wrapper = gu_common .ConfigWrapper ()
86
122
0 commit comments