PR to fix ios bgp TC failure (#58010)

* fix ios bgp tc failure

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* skip test with 15.6(T)2 ios

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* skip test with 15.6(T)2 ios

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
This commit is contained in:
Sumit Jaiswal 2019-06-20 20:39:32 +05:30 committed by Daniel Mellado Area
parent 2b5ad94a96
commit 77b6255305

View file

@ -5,7 +5,9 @@
operation: delete operation: delete
ignore_errors: yes ignore_errors: yes
- name: Configure BGP with AS 64496 and a router-id - block:
- name: Configure BGP with AS 64496 and a router-id
ios_bgp: &config ios_bgp: &config
operation: merge operation: merge
config: config:
@ -13,21 +15,21 @@
router_id: 192.0.2.2 router_id: 192.0.2.2
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == true' - 'result.changed == true'
- "'router bgp 64496' in result.commands" - "'router bgp 64496' in result.commands"
- "'bgp router-id 192.0.2.2' in result.commands" - "'bgp router-id 192.0.2.2' in result.commands"
- name: Configure BGP with AS 64496 and a router-id (idempotent) - name: Configure BGP with AS 64496 and a router-id (idempotent)
ios_bgp: *config ios_bgp: *config
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
- name: Configure BGP neighbors - name: Configure BGP neighbors
ios_bgp: &nbr ios_bgp: &nbr
operation: merge operation: merge
config: config:
@ -49,7 +51,7 @@
ebgp_multihop: 150 ebgp_multihop: 150
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == true' - 'result.changed == true'
- "'router bgp 64496' in result.commands" - "'router bgp 64496' in result.commands"
@ -61,15 +63,15 @@
- "'neighbor 192.0.2.15 description IBGP_NBR_2' in result.commands" - "'neighbor 192.0.2.15 description IBGP_NBR_2' in result.commands"
- "'neighbor 192.0.2.15 ebgp-multihop 150' in result.commands" - "'neighbor 192.0.2.15 ebgp-multihop 150' in result.commands"
- name: Configure BGP neighbors (idempotent) - name: Configure BGP neighbors (idempotent)
ios_bgp: *nbr ios_bgp: *nbr
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
- name: Configure BGP neighbors with operation replace - name: Configure BGP neighbors with operation replace
ios_bgp: &nbr_rplc ios_bgp: &nbr_rplc
operation: replace operation: replace
config: config:
@ -86,7 +88,7 @@
local_as: 64497 local_as: 64497
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == true' - 'result.changed == true'
- "'neighbor 203.0.113.10 remote-as 64511' in result.commands" - "'neighbor 203.0.113.10 remote-as 64511' in result.commands"
@ -94,15 +96,15 @@
- "'neighbor 203.0.113.10 local-as 64497' in result.commands" - "'neighbor 203.0.113.10 local-as 64497' in result.commands"
- "'no neighbor 192.0.2.10' in result.commands" - "'no neighbor 192.0.2.10' in result.commands"
- name: Configure BGP neighbors with operation replace (idempotent) - name: Configure BGP neighbors with operation replace (idempotent)
ios_bgp: *nbr_rplc ios_bgp: *nbr_rplc
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
- name: Configure root-level networks for BGP - name: Configure root-level networks for BGP
ios_bgp: &net ios_bgp: &net
operation: merge operation: merge
config: config:
@ -117,22 +119,22 @@
route_map: RMAP_2 route_map: RMAP_2
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == True' - 'result.changed == True'
- "'router bgp 64496' in result.commands" - "'router bgp 64496' in result.commands"
- "'network 203.0.113.0 mask 255.255.255.224 route-map RMAP_1' in result.commands" - "'network 203.0.113.0 mask 255.255.255.224 route-map RMAP_1' in result.commands"
- "'network 203.0.113.32 mask 255.255.255.224 route-map RMAP_2' in result.commands" - "'network 203.0.113.32 mask 255.255.255.224 route-map RMAP_2' in result.commands"
- name: Configure root-level networks for BGP (idempotent) - name: Configure root-level networks for BGP (idempotent)
ios_bgp: *net ios_bgp: *net
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
- name: Configure root-level networks for BGP with operation replace - name: Configure root-level networks for BGP with operation replace
ios_bgp: &net_rplc ios_bgp: &net_rplc
operation: replace operation: replace
config: config:
@ -146,22 +148,22 @@
masklen: 28 masklen: 28
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == True' - 'result.changed == True'
- "'router bgp 64496' in result.commands" - "'router bgp 64496' in result.commands"
- "'network 198.51.100.16 mask 255.255.255.240' in result.commands" - "'network 198.51.100.16 mask 255.255.255.240' in result.commands"
- "'no network 203.0.113.32 mask 255.255.255.224 route-map RMAP_2' in result.commands" - "'no network 203.0.113.32 mask 255.255.255.224 route-map RMAP_2' in result.commands"
- name: Configure root-level networks for BGP with operation replace (idempotent) - name: Configure root-level networks for BGP with operation replace (idempotent)
ios_bgp: *net_rplc ios_bgp: *net_rplc
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
- name: Configure BGP neighbors under address family mode - name: Configure BGP neighbors under address family mode
ios_bgp: &af_nbr ios_bgp: &af_nbr
operation: merge operation: merge
config: config:
@ -180,7 +182,7 @@
route_reflector_client: True route_reflector_client: True
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == true' - 'result.changed == true'
- "'router bgp 64496' in result.commands" - "'router bgp 64496' in result.commands"
@ -191,15 +193,15 @@
- "'neighbor 192.0.2.15 activate' in result.commands" - "'neighbor 192.0.2.15 activate' in result.commands"
- "'neighbor 192.0.2.15 route-reflector-client' in result.commands" - "'neighbor 192.0.2.15 route-reflector-client' in result.commands"
- name: Configure BGP neighbors under address family mode (idempotent) - name: Configure BGP neighbors under address family mode (idempotent)
ios_bgp: *af_nbr ios_bgp: *af_nbr
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
- name: Configure networks under address family - name: Configure networks under address family
ios_bgp: &af_net ios_bgp: &af_net
operation: merge operation: merge
config: config:
@ -226,7 +228,7 @@
masklen: 28 masklen: 28
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == true' - 'result.changed == true'
- "'router bgp 64496' in result.commands" - "'router bgp 64496' in result.commands"
@ -239,15 +241,15 @@
- "'network 198.51.100.64 mask 255.255.255.240' in result.commands" - "'network 198.51.100.64 mask 255.255.255.240' in result.commands"
- "'exit-address-family' in result.commands" - "'exit-address-family' in result.commands"
- name: Configure networks under address family (idempotent) - name: Configure networks under address family (idempotent)
ios_bgp: *af_net ios_bgp: *af_net
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
- name: Configure networks under address family with operation replace - name: Configure networks under address family with operation replace
ios_bgp: &af_net_rplc ios_bgp: &af_net_rplc
operation: replace operation: replace
config: config:
@ -272,7 +274,7 @@
masklen: 28 masklen: 28
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == true' - 'result.changed == true'
- '"router bgp 64496" in result.commands' - '"router bgp 64496" in result.commands'
@ -283,15 +285,15 @@
- '"no network 203.0.113.160 mask 255.255.255.224 route-map RMAP_2" in result.commands' - '"no network 203.0.113.160 mask 255.255.255.224 route-map RMAP_2" in result.commands'
- '"exit-address-family" in result.commands' - '"exit-address-family" in result.commands'
- name: Configure networks under address family with operation replace (idempotent) - name: Configure networks under address family with operation replace (idempotent)
ios_bgp: *af_net_rplc ios_bgp: *af_net_rplc
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
- name: Configure redistribute information under address family mode - name: Configure redistribute information under address family mode
ios_bgp: &af_rdr ios_bgp: &af_rdr
operation: merge operation: merge
config: config:
@ -309,7 +311,7 @@
metric: 256 metric: 256
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == true' - 'result.changed == true'
- "'router bgp 64496' in result.commands" - "'router bgp 64496' in result.commands"
@ -318,15 +320,19 @@
- "'redistribute eigrp 233 metric 256' in result.commands" - "'redistribute eigrp 233 metric 256' in result.commands"
- "'exit-address-family' in result.commands" - "'exit-address-family' in result.commands"
- name: Configure redistribute information under address family mode (idempotent) - name: Configure redistribute information under address family mode (idempotent)
ios_bgp: *af_rdr ios_bgp: *af_rdr
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
- name: Configure redistribute information under address family mode with operation replace - name: Get the IOS version
ios_facts:
gather_subset: all
- name: Configure redistribute information under address family mode with operation replace
ios_bgp: &af_rdr_rplc ios_bgp: &af_rdr_rplc
operation: replace operation: replace
config: config:
@ -340,7 +346,7 @@
metric: 64 metric: 64
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == true' - 'result.changed == true'
- "'router bgp 64496' in result.commands" - "'router bgp 64496' in result.commands"
@ -348,15 +354,17 @@
- "'no redistribute eigrp 233' in result.commands" - "'no redistribute eigrp 233' in result.commands"
- "'exit-address-family' in result.commands" - "'exit-address-family' in result.commands"
- name: Configure redistribute information under address family mode with operation replace (idempotent) - name: Configure redistribute information under address family mode with operation replace (idempotent)
ios_bgp: *af_rdr_rplc ios_bgp: *af_rdr_rplc
register: result register: result
when: ansible_net_version != "15.6(2)T"
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'
when: ansible_net_version != "15.6(2)T"
- name: Override all the exisiting BGP config - name: Override all the exisiting BGP config
ios_bgp: ios_bgp:
operation: override operation: override
config: config:
@ -365,7 +373,7 @@
log_neighbor_changes: True log_neighbor_changes: True
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == true' - 'result.changed == true'
- "'no router bgp 64496' in result.commands" - "'no router bgp 64496' in result.commands"
@ -373,21 +381,22 @@
- "'bgp router-id 192.0.2.10' in result.commands" - "'bgp router-id 192.0.2.10' in result.commands"
- "'bgp log-neighbor-changes' in result.commands" - "'bgp log-neighbor-changes' in result.commands"
- name: Teardown always:
- name: Teardown
ios_bgp: &rm ios_bgp: &rm
operation: delete operation: delete
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == true' - 'result.changed == true'
- "'no router bgp 64497' in result.commands" - "'no router bgp 64497' in result.commands"
- name: Teardown again (idempotent) - name: Teardown again (idempotent)
ios_bgp: *rm ios_bgp: *rm
register: result register: result
- assert: - assert:
that: that:
- 'result.changed == false' - 'result.changed == false'