@@ -170,6 +170,7 @@ def test_create_subnet_postcommit_private(nautobot_client):
170
170
"network_id" : "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" ,
171
171
"cidr" : "1.0.0.0/24" ,
172
172
"router:external" : False ,
173
+ "service_types" : [],
173
174
}
174
175
)
175
176
@@ -183,13 +184,14 @@ def test_create_subnet_postcommit_private(nautobot_client):
183
184
)
184
185
185
186
186
- def test_create_subnet_postcommit_public (nautobot_client , undersync_client ):
187
+ def test_create_subnet_postcommit_public_svi (nautobot_client , undersync_client ):
187
188
context = MagicMock (
188
189
current = {
189
190
"id" : "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" ,
190
191
"network_id" : "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" ,
191
192
"cidr" : "1.0.0.0/24" ,
192
193
"router:external" : True ,
194
+ "service_types" : ["network:understack_svi" ],
193
195
}
194
196
)
195
197
@@ -203,6 +205,27 @@ def test_create_subnet_postcommit_public(nautobot_client, undersync_client):
203
205
prefix = "1.0.0.0/24" ,
204
206
namespace_name = "Global" ,
205
207
)
208
+ nautobot_client .associate_subnet_with_network .assert_called_once ()
209
+
210
+
211
+ def test_create_subnet_postcommit_public_non_svi (nautobot_client , undersync_client ):
212
+ context = MagicMock (
213
+ current = {
214
+ "id" : "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" ,
215
+ "network_id" : "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" ,
216
+ "cidr" : "1.0.0.0/24" ,
217
+ "router:external" : True ,
218
+ "service_types" : ["not_an_svi_type" ],
219
+ }
220
+ )
221
+
222
+ driver .nb = nautobot_client
223
+ driver .undersync = undersync_client
224
+
225
+ driver .create_subnet_postcommit (context )
226
+
227
+ nautobot_client .subnet_create .assert_called_once ()
228
+ nautobot_client .associate_subnet_with_network .assert_not_called ()
206
229
207
230
208
231
def test_delete_subnet_postcommit_public (nautobot_client , undersync_client ):
0 commit comments