Skip to content

Commit 31e77fa

Browse files
second round of review changes in sr_peering tests
1 parent 8dae429 commit 31e77fa

12 files changed

+4136
-1706
lines changed

tests/integration/targets/dcnm_service_route_peering/tests/dcnm/dcnm_service_route_peering_adc_po_change.yaml

Lines changed: 379 additions & 101 deletions
Large diffs are not rendered by default.

tests/integration/targets/dcnm_service_route_peering/tests/dcnm/dcnm_service_route_peering_delete.yaml

Lines changed: 498 additions & 7 deletions
Large diffs are not rendered by default.

tests/integration/targets/dcnm_service_route_peering/tests/dcnm/dcnm_service_route_peering_fw_po_change.yaml

Lines changed: 183 additions & 103 deletions
Large diffs are not rendered by default.

tests/integration/targets/dcnm_service_route_peering/tests/dcnm/dcnm_service_route_peering_merge.yaml

Lines changed: 282 additions & 68 deletions
Large diffs are not rendered by default.

tests/integration/targets/dcnm_service_route_peering/tests/dcnm/dcnm_service_route_peering_merge_existing.yaml

Lines changed: 790 additions & 59 deletions
Large diffs are not rendered by default.

tests/integration/targets/dcnm_service_route_peering/tests/dcnm/dcnm_service_route_peering_no_opt_elems.yaml

Lines changed: 173 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
state: deleted
1313
register: result
1414

15-
- name: Assert
16-
ansible.builtin.assert:
15+
- ansible.builtin.assert:
1716
that:
1817
- 'item["RETURN_CODE"] == 200'
19-
loop: '{{ result.response }}'
18+
loop: '{{ result.response }}'
2019

2120

2221
- block:
@@ -25,47 +24,194 @@
2524
## MERGE ##
2625
##############################################
2726

28-
- name: Create different non-existing service route peerings including all objects - false optional elements
27+
- name: Create different non-existing service route peerings including all objects - no optional elements
2928
cisco.dcnm.dcnm_service_route_peering: &dcnm_srp_all
3029
fabric: "{{ ansible_it_fabric }}"
3130
service_fabric: "{{ ansible_it_service_fabric }}"
3231
config:
3332
- name: IT-FW-RP1 # mandatory
34-
node_name: "{{ ansible_snode_1 }}" # mandatory
35-
deploy_mode: intra_tenant_fw # mandatory, choices=[intra_tenant_fw, inter_tenant_fw]
36-
inside_network:
37-
name: Rp1-sn1-inside-net # mandatory
33+
node_name: "{{ ansible_snode_1 }}" # mandatory
34+
deploy_mode: intra_tenant_fw # mandatory, choices=[intra_tenant_fw, inter_tenant_fw]
35+
inside_network: #
36+
vrf: "{{ ansible_vrf_11 }}" # mandatory
37+
name: rp1-sn1-inside-net # mandatory
3838
profile:
39-
ipv4_gw: 192.161.1.1/24 # mandatory
40-
next_hop: 192.161.1.100 # mandatory
41-
outside_network:
42-
vrf: "{{ ansible_vrf_11 }}" # mandatory
43-
name: Rp1-sn1-outside-net # mandatory
39+
ipv4_gw: 192.161.1.1/24 # mandatory
40+
next_hop: 192.161.1.100 # mandatory
41+
outside_network: #
42+
vrf: "{{ ansible_vrf_11 }}" # mandatory
43+
name: rp1-sn1-outside-net # mandatory
4444
profile:
45-
ipv4_gw: 192.161.2.1/24 # mandatory
45+
ipv4_gw: 192.161.2.1/24 # mandatory
4646

4747
- name: IT-FW-RP2 # mandatory
48-
node_name: "{{ ansible_snode_1 }}" # mandatory
49-
deploy_mode: inter_tenant_fw # mandatory, choices=[intra_tenant_fw, inter_tenant_fw]
48+
node_name: "{{ ansible_snode_1 }}" # mandatory
49+
deploy_mode: inter_tenant_fw # mandatory, choices=[intra_tenant_fw, inter_tenant_fw]
50+
inside_network: #
51+
vrf: "{{ ansible_vrf_21 }}" # mandatory
52+
name: rp2-sn1-inside-net # mandatory
53+
profile:
54+
ipv4_gw: 192.162.1.1/24 # mandatory
55+
outside_network: #
56+
vrf: "{{ ansible_vrf_22 }}" # mandatory
57+
name: rp2-sn1-outside-net # mandatory
58+
profile:
59+
ipv4_gw: 192.162.2.1/24 # mandatory
60+
61+
- name: IT-FW-RP3 # mandatory
62+
node_name: "{{ ansible_snode_1 }}" # mandatory
63+
deploy_mode: inter_tenant_fw # mandatory, choices=[intra_tenant_fw, inter_tenant_fw]
64+
peering_option: ebgp # optional, default is static, choices=[static, ebgp]
5065
inside_network:
51-
vrf: "{{ ansible_vrf_21 }}" # mandatory
52-
name: Rp2-sn1-inside-net # mandatory
66+
vrf: "{{ ansible_vrf_31 }}" # mandatory
67+
name: rp3-sn1-inside-net # mandatory
5368
profile:
54-
ipv4_gw: 192.162.1.1/24 # mandatory
69+
ipv4_gw: 192.163.1.1/24 # mandatory
70+
ipv4_neighbor: 31.31.31.1 # mandatory
71+
ipv4_lo: 31.7.1.2 # mandatory
72+
ipv4_vpc_peer_lo: 31.7.1.3 # optional, default is ''
73+
ipv6_vpc_peer_lo: 2003:0702::1 # optional, default is ''
5574
outside_network:
56-
vrf: "{{ ansible_vrf_22 }}" # mandatory
57-
name: Rp2-sn1-outside-net # mandatory
75+
vrf: "{{ ansible_vrf_32 }}" # mandatory
76+
name: rp3-sn1-outside-net # mandatory
77+
profile:
78+
ipv4_gw: 192.163.2.1/24 # mandatory
79+
ipv4_neighbor: 131.131.131.1 # mandatory
80+
ipv4_lo: 131.7.1.2 # mandatory
81+
ipv4_vpc_peer_lo: 131.7.1.3 # optional, default is ''
82+
ipv6_vpc_peer_lo: 2003:0704::1 # optional, default is ''
83+
adv_host: true # optional, default is false
84+
85+
- name: IT-ADC-RP4
86+
node_name: "{{ ansible_snode_2 }}" # mandatory
87+
deploy_mode: one_arm_adc # mandatory, choices=[one_arm_adc, two_arm_adc]
88+
peering_option: ebgp # optional, default is static, choices=[static, ebgp]
89+
first_arm:
90+
vrf: "{{ ansible_vrf_41 }}" # mandatory
91+
name: rp4-sn2-first-arm # mandatory
92+
profile:
93+
ipv4_gw: 192.164.1.1/24 # mandatory
94+
ipv4_neighbor: 41.41.41.1 # mandatory
95+
ipv4_lo: 41.7.1.2 # mandatory
96+
ipv4_vpc_peer_lo: 41.7.1.3 # optional, default is ''
97+
ipv6_vpc_peer_lo: 2004:0702::1 # optional, default is ''
98+
reverse_next_hop: 192.164.1.100 # mandatory
99+
100+
- name: IT-ADC-RP5
101+
node_name: "{{ ansible_snode_2 }}" # mandatory
102+
deploy_mode: two_arm_adc # mandatory, choices=[one_arm_adc, two_arm_adc]
103+
peering_option: ebgp # optional, default is static, choices=[static, ebgp]
104+
first_arm:
105+
vrf: "{{ ansible_vrf_51 }}" # mandatory
106+
name: rp5-sn2-first-arm # mandatory
107+
profile:
108+
ipv4_gw: 192.165.1.1/24 # mandatory
109+
ipv4_neighbor: 51.51.51.1 # mandatory
110+
ipv4_lo: 51.7.1.2 # mandatory
111+
ipv4_vpc_peer_lo: 51.7.1.3 # optional, default is ''
112+
ipv6_vpc_peer_lo: 2005:0702::1 # optional, default is ''
113+
second_arm:
114+
vrf: "{{ ansible_vrf_51 }}" # mandatory
115+
name: rp5-sn2-second-arm # mandatory
116+
profile:
117+
ipv4_gw: 192.165.2.1/24 # mandatory
118+
reverse_next_hop: 192.165.1.100 # mandatory
119+
120+
- name: IT-ADC-RP6
121+
node_name: "{{ ansible_snode_2 }}" # mandatory
122+
deploy_mode: one_arm_adc # mandatory, choices=[one_arm_adc, two_arm_adc]
123+
first_arm:
124+
vrf: "{{ ansible_vrf_61 }}" # mandatory
125+
name: rp6-sn2-first-arm # mandatory
58126
profile:
59-
ipv4_gw: 192.162.2.1/24 # mandatory
127+
ipv4_gw: 192.166.1.1/24 # mandatory
128+
reverse_next_hop: 192.166.1.100 # mandatory
129+
130+
- name: IT-ADC-RP7
131+
node_name: "{{ ansible_snode_2 }}" # mandatory
132+
deploy_mode: two_arm_adc # mandatory, choices=[one_arm_adc, two_arm_adc]
133+
first_arm:
134+
vrf: "{{ ansible_vrf_71 }}" # mandatory
135+
name: rp7-sn2-first-arm # mandatory
136+
profile:
137+
ipv4_gw: 192.167.1.1/24 # mandatory
138+
second_arm:
139+
vrf: "{{ ansible_vrf_71 }}" # mandatory
140+
name: rp7-sn2-second-arm # mandatory
141+
profile:
142+
ipv4_gw: 192.167.2.1/24 # mandatory
143+
reverse_next_hop: 192.167.1.100 # mandatory
144+
attach: true
145+
deploy: true
146+
state: merged
147+
register: result
148+
149+
- ansible.builtin.assert:
150+
that:
151+
- 'result.changed == true'
152+
- '(result["diff"][0]["merged"] | length) == 7'
153+
- '(result["diff"][0]["deleted"] | length) == 0'
154+
- '(result["diff"][0]["modified"] | length) == 0'
155+
- '(result["diff"][0]["query"] | length) == 0'
156+
- '(result["diff"][0]["deploy"] | length) == 7'
157+
158+
- ansible.builtin.assert:
159+
that:
160+
- 'item["RETURN_CODE"] == 200'
161+
loop: '{{ result.response }}'
162+
163+
- name: Create service route peerings - Idempotence
164+
cisco.dcnm.dcnm_service_route_peering: *dcnm_srp_all
165+
register: result
166+
167+
- ansible.builtin.assert:
168+
that:
169+
- 'result.changed == false'
170+
- '(result["diff"][0]["merged"] | length) == 0'
171+
- '(result["diff"][0]["deleted"] | length) == 0'
172+
- '(result["diff"][0]["modified"] | length) == 0'
173+
- '(result["diff"][0]["query"] | length) == 0'
174+
- '(result["diff"][0]["deploy"] | length) == 0'
60175

61176
##############################################
62-
## CLEANUP ##
177+
## CLEANUP ##
63178
##############################################
64179

65-
- name: Clean up - Delete all route peerings
180+
always:
181+
182+
183+
- name: Delete all created route peerings
66184
cisco.dcnm.dcnm_service_route_peering:
67-
state: deleted
68185
fabric: "{{ ansible_it_fabric }}"
69186
service_fabric: "{{ ansible_it_service_fabric }}"
70-
config: []
71-
register: cleanup_result
187+
config:
188+
- name: IT-FW-RP1 # mandatory
189+
node_name: "{{ ansible_snode_1 }}" # mandatory
190+
191+
- name: IT-FW-RP2 # mandatory
192+
node_name: "{{ ansible_snode_1 }}" # mandatory
193+
194+
- name: IT-FW-RP3 # mandatory
195+
node_name: "{{ ansible_snode_1 }}" # mandatory
196+
197+
- name: IT-ADC-RP4 # mandatory
198+
node_name: "{{ ansible_snode_2 }}" # mandatory
199+
200+
- name: IT-ADC-RP5 # mandatory
201+
node_name: "{{ ansible_snode_2 }}" # mandatory
202+
203+
- name: IT-ADC-RP6 # mandatory
204+
node_name: "{{ ansible_snode_2 }}" # mandatory
205+
206+
- name: IT-ADC-RP7 # mandatory
207+
node_name: "{{ ansible_snode_2 }}" # mandatory
208+
209+
state: deleted
210+
register: result
211+
when: IT_CONTEXT is not defined
212+
213+
- ansible.builtin.assert:
214+
that:
215+
- 'item["RETURN_CODE"] == 200'
216+
loop: '{{ result.response }}'
217+
when: IT_CONTEXT is not defined

0 commit comments

Comments
 (0)