|
512 | 512 | ansible.builtin.assert:
|
513 | 513 | that:
|
514 | 514 | - nm_remove_again_stat2e2 is not changed
|
515 |
| - |
516 |
| -# ADD STATIC PORT WITH VLAN |
517 |
| -- name: Add static port 3 (dpc) to EPG6 of AP2 with VLAN (success) |
518 |
| - cisco.mso.mso_schema_site_anp_epg_staticport: |
519 |
| - <<: *mso_info |
520 |
| - schema: '{{ mso_schema | default("ansible_test") }}' |
521 |
| - site: '{{ mso_site | default("ansible_test") }}' |
522 |
| - template: Template 1 |
523 |
| - anp: AP2 |
524 |
| - epg: EPG6 |
525 |
| - pod: pod-2 |
526 |
| - leaf: 102 |
527 |
| - path: eth1/3 |
528 |
| - vlan: 100 |
529 |
| - deployment_immediacy: lazy |
530 |
| - mode: regular |
531 |
| - type: dpc |
532 |
| - primary_micro_segment_vlan: 199 |
533 |
| - state: present |
534 |
| - |
535 |
| -# REMOVE STATIC PORT WITHOUT VLAN |
536 |
| -- name: Remove static port 3 (dpc) from EPG6 of AP2 without VLAN (success) |
537 |
| - cisco.mso.mso_schema_site_anp_epg_staticport: |
538 |
| - <<: *mso_info |
539 |
| - schema: '{{ mso_schema | default("ansible_test") }}' |
540 |
| - site: '{{ mso_site | default("ansible_test") }}' |
541 |
| - template: Template 1 |
542 |
| - anp: AP2 |
543 |
| - epg: EPG6 |
544 |
| - pod: pod-2 |
545 |
| - leaf: 102 |
546 |
| - path: eth1/3 |
547 |
| - state: absent |
548 |
| - register: nm_add_stat3e6 |
549 |
| - |
550 |
| -- name: Verify nm_add_stat3e6 |
551 |
| - ansible.builtin.assert: |
552 |
| - that: |
553 |
| - - nm_add_stat3e6 is changed |
554 |
| - - nm_add_stat3e6.current == {} |
555 | 515 |
|
556 | 516 | # ADD EXISTING STATIC PORT
|
557 | 517 | - name: Add static port 1 to site EPG1 again (normal mode)
|
|
1212 | 1172 | - nm_remove_static_ports_2.current.9.path == "topology/pod-1/paths-101/pathep-[eth2/9]"
|
1213 | 1173 | - nm_remove_static_ports_2.current.9.portEncapVlan == 1209
|
1214 | 1174 |
|
1215 |
| -# ADD STATIC PORT WITH VLAN (BULK) |
1216 |
| -- name: Add static port 3 & 4 (dpc) to epg_bulk of anp_bulk with VLAN (success) |
1217 |
| - cisco.mso.mso_schema_site_anp_epg_staticport: |
1218 |
| - <<: *mso_info |
1219 |
| - schema: '{{ mso_schema | default("ansible_test") }}' |
1220 |
| - site: '{{ mso_site | default("ansible_test") }}' |
1221 |
| - template: template_bulk |
1222 |
| - anp: anp_bulk |
1223 |
| - epg: epg_bulk |
1224 |
| - static_ports: |
1225 |
| - - pod: pod-2 |
1226 |
| - leaf: 102 |
1227 |
| - path: eth1/3 |
1228 |
| - vlan: 100 |
1229 |
| - deployment_immediacy: lazy |
1230 |
| - mode: regular |
1231 |
| - type: dpc |
1232 |
| - primary_micro_segment_vlan: 199 |
1233 |
| - - pod: pod-2 |
1234 |
| - leaf: 102 |
1235 |
| - path: eth1/4 |
1236 |
| - vlan: 100 |
1237 |
| - deployment_immediacy: lazy |
1238 |
| - mode: regular |
1239 |
| - type: dpc |
1240 |
| - primary_micro_segment_vlan: 199 |
1241 |
| - state: present |
1242 |
| - register: nm_add_bulk_stat3e6 |
1243 |
| - |
1244 |
| -- name: Verify nm_add_bulk_stat3e6 |
1245 |
| - ansible.builtin.assert: |
1246 |
| - that: |
1247 |
| - - nm_add_bulk_stat3e6 is changed |
1248 |
| - - nm_add_bulk_stat3e6.previous | length == 10 |
1249 |
| - - nm_add_bulk_stat3e6.previous.0.path == "topology/pod-1/paths-101/pathep-[eth1/1]" |
1250 |
| - - nm_add_bulk_stat3e6.previous.0.portEncapVlan == 1101 |
1251 |
| - - nm_add_bulk_stat3e6.previous.2.path == "topology/pod-1/paths-101/pathep-[eth1/5]" |
1252 |
| - - nm_add_bulk_stat3e6.previous.2.portEncapVlan == 1105 |
1253 |
| - - nm_add_bulk_stat3e6.previous.4.path == "topology/pod-1/paths-101/pathep-[eth1/9]" |
1254 |
| - - nm_add_bulk_stat3e6.previous.4.portEncapVlan == 1109 |
1255 |
| - - nm_add_bulk_stat3e6.previous.5.path == "topology/pod-1/paths-101/pathep-[eth2/1]" |
1256 |
| - - nm_add_bulk_stat3e6.previous.5.portEncapVlan == 1201 |
1257 |
| - - nm_add_bulk_stat3e6.previous.7.path == "topology/pod-1/paths-101/pathep-[eth2/5]" |
1258 |
| - - nm_add_bulk_stat3e6.previous.7.portEncapVlan == 1205 |
1259 |
| - - nm_add_bulk_stat3e6.previous.9.path == "topology/pod-1/paths-101/pathep-[eth2/9]" |
1260 |
| - - nm_add_bulk_stat3e6.previous.9.portEncapVlan == 1209 |
1261 |
| - - nm_add_bulk_stat3e6.current | length == 12 |
1262 |
| - - nm_add_bulk_stat3e6.current.10.deploymentImmediacy == 'lazy' |
1263 |
| - - nm_add_bulk_stat3e6.current.10.portEncapVlan == 100 |
1264 |
| - - nm_add_bulk_stat3e6.current.10.microSegVlan == 199 |
1265 |
| - - nm_add_bulk_stat3e6.current.10.path == 'topology/pod-2/paths-102/pathep-[eth1/3]' |
1266 |
| - - nm_add_bulk_stat3e6.current.10.mode == 'regular' |
1267 |
| - - nm_add_bulk_stat3e6.current.10.type == 'dpc' |
1268 |
| - - nm_add_bulk_stat3e6.current.11.deploymentImmediacy == 'lazy' |
1269 |
| - - nm_add_bulk_stat3e6.current.11.portEncapVlan == 100 |
1270 |
| - - nm_add_bulk_stat3e6.current.11.microSegVlan == 199 |
1271 |
| - - nm_add_bulk_stat3e6.current.11.path == 'topology/pod-2/paths-102/pathep-[eth1/4]' |
1272 |
| - - nm_add_bulk_stat3e6.current.11.mode == 'regular' |
1273 |
| - - nm_add_bulk_stat3e6.current.11.type == 'dpc' |
1274 |
| - |
1275 |
| -# REMOVE STATIC PORT WITHOUT VLAN (BULK) |
1276 |
| -- name: Remove static port 3 & 4 (dpc) from epg_bulk of anp_bulk without VLAN (success) |
1277 |
| - cisco.mso.mso_schema_site_anp_epg_staticport: |
1278 |
| - <<: *mso_info |
1279 |
| - schema: '{{ mso_schema | default("ansible_test") }}' |
1280 |
| - site: '{{ mso_site | default("ansible_test") }}' |
1281 |
| - template: template_bulk |
1282 |
| - anp: anp_bulk |
1283 |
| - epg: epg_bulk |
1284 |
| - static_ports: |
1285 |
| - - pod: pod-2 |
1286 |
| - leaf: 102 |
1287 |
| - path: eth1/3 |
1288 |
| - - pod: pod-2 |
1289 |
| - leaf: 102 |
1290 |
| - path: eth1/4 |
1291 |
| - state: absent |
1292 |
| - register: nm_rm_bulk_stat3e6 |
1293 |
| - |
1294 |
| -- name: Verify nm_rm_bulk_stat3e6 |
1295 |
| - ansible.builtin.assert: |
1296 |
| - that: |
1297 |
| - - nm_rm_bulk_stat3e6 is changed |
1298 |
| - - nm_rm_bulk_stat3e6.current | length == 10 |
1299 |
| - - nm_add_bulk_stat3e6.current.0.path == "topology/pod-1/paths-101/pathep-[eth1/1]" |
1300 |
| - - nm_add_bulk_stat3e6.current.0.portEncapVlan == 1101 |
1301 |
| - - nm_add_bulk_stat3e6.current.2.path == "topology/pod-1/paths-101/pathep-[eth1/5]" |
1302 |
| - - nm_add_bulk_stat3e6.current.2.portEncapVlan == 1105 |
1303 |
| - - nm_add_bulk_stat3e6.current.4.path == "topology/pod-1/paths-101/pathep-[eth1/9]" |
1304 |
| - - nm_add_bulk_stat3e6.current.4.portEncapVlan == 1109 |
1305 |
| - - nm_add_bulk_stat3e6.current.5.path == "topology/pod-1/paths-101/pathep-[eth2/1]" |
1306 |
| - - nm_add_bulk_stat3e6.current.5.portEncapVlan == 1201 |
1307 |
| - - nm_add_bulk_stat3e6.current.7.path == "topology/pod-1/paths-101/pathep-[eth2/5]" |
1308 |
| - - nm_add_bulk_stat3e6.current.7.portEncapVlan == 1205 |
1309 |
| - - nm_add_bulk_stat3e6.current.9.path == "topology/pod-1/paths-101/pathep-[eth2/9]" |
1310 |
| - - nm_add_bulk_stat3e6.current.9.portEncapVlan == 1209 |
1311 |
| - |
1312 | 1175 | # FORCE REPLACE TESTS
|
1313 | 1176 |
|
1314 | 1177 | - name: Force replace static ports with static ports (check_mode)
|
|
1503 | 1366 | - force_remove_all_new_static.previous == []
|
1504 | 1367 | - force_remove_all_new_static.current | length == 1
|
1505 | 1368 |
|
| 1369 | +# WITHOUT VLAN REMOVAL TEST |
| 1370 | +- name: Create static ports for without VLAN removal tests |
| 1371 | + cisco.mso.mso_schema_site_anp_epg_staticport: |
| 1372 | + <<: *mso_info |
| 1373 | + schema: '{{ mso_schema | default("ansible_test") }}' |
| 1374 | + site: '{{ mso_site | default("ansible_test") }}' |
| 1375 | + template: template_bulk |
| 1376 | + anp: anp_bulk |
| 1377 | + epg: epg_bulk |
| 1378 | + static_ports: |
| 1379 | + - pod: pod-2 |
| 1380 | + leaf: 102 |
| 1381 | + path: eth1/1 |
| 1382 | + vlan: 101 |
| 1383 | + - pod: pod-2 |
| 1384 | + leaf: 102 |
| 1385 | + path: eth1/2 |
| 1386 | + vlan: 102 |
| 1387 | + - pod: pod-2 |
| 1388 | + leaf: 102 |
| 1389 | + path: eth1/3 |
| 1390 | + vlan: 103 |
| 1391 | + state: present |
| 1392 | + |
| 1393 | +- name: Remove a static port without VLAN |
| 1394 | + cisco.mso.mso_schema_site_anp_epg_staticport: |
| 1395 | + <<: *mso_info |
| 1396 | + schema: '{{ mso_schema | default("ansible_test") }}' |
| 1397 | + site: '{{ mso_site | default("ansible_test") }}' |
| 1398 | + template: template_bulk |
| 1399 | + anp: anp_bulk |
| 1400 | + epg: epg_bulk |
| 1401 | + pod: pod-2 |
| 1402 | + leaf: 102 |
| 1403 | + path: eth1/1 |
| 1404 | + state: absent |
| 1405 | + register: rm_stat_without_vlan |
| 1406 | + |
| 1407 | +- name: Verify rm_stat_without_vlan |
| 1408 | + ansible.builtin.assert: |
| 1409 | + that: |
| 1410 | + - rm_stat_without_vlan is changed |
| 1411 | + - rm_stat_without_vlan.current == {} |
| 1412 | + |
| 1413 | +- name: Remove multiple static ports in bulk without VLAN |
| 1414 | + cisco.mso.mso_schema_site_anp_epg_staticport: |
| 1415 | + <<: *mso_info |
| 1416 | + schema: '{{ mso_schema | default("ansible_test") }}' |
| 1417 | + site: '{{ mso_site | default("ansible_test") }}' |
| 1418 | + template: template_bulk |
| 1419 | + anp: anp_bulk |
| 1420 | + epg: epg_bulk |
| 1421 | + static_ports: |
| 1422 | + - pod: pod-2 |
| 1423 | + leaf: 102 |
| 1424 | + path: eth1/2 |
| 1425 | + - pod: pod-2 |
| 1426 | + leaf: 102 |
| 1427 | + path: eth1/3 |
| 1428 | + state: absent |
| 1429 | + register: rm_bulk_stat_without_vlan |
| 1430 | + |
| 1431 | +- name: Verify rm_bulk_stat_without_vlan |
| 1432 | + ansible.builtin.assert: |
| 1433 | + that: |
| 1434 | + - rm_bulk_stat_without_vlan is changed |
| 1435 | + - rm_bulk_stat_without_vlan.current == [] |
| 1436 | + |
1506 | 1437 | # OVERWRITE ARGUMENTS
|
1507 | 1438 |
|
1508 | 1439 | - name: Overwrite static port arguments (error)
|
|
0 commit comments