Skip to content

Commit

Permalink
Fix downstream test failures (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
roverflow authored Jan 15, 2025
1 parent 5070f32 commit 769c0f5
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
---
- name: Enable RM policy rm-policy
register: result
cisco.iosxr.iosxr_config:
lines:
- route-policy rm-policy
- end-policy

- name: Enable RM policy rm-policy1
register: result
cisco.iosxr.iosxr_config:
lines:
- route-policy rm-policy1
- end-policy

- name: Enable RM policy test-policy
register: result
cisco.iosxr.iosxr_config:
lines:
- route-policy test-policy
- end-policy

- name: Merge provided configuration with device configuration
register: result
when: populate_init_config | default(true)
cisco.iosxr.iosxr_config:
lines:
- vrf VRF4
- address-family ipv4 unicast
- export route-policy rm-policy
- export route-target 192.0.2.1:400
- export to default-vrf route-policy rm-policy
Expand All @@ -15,3 +35,6 @@
- import from default-vrf route-policy test-policy
- import from vrf advertise-as-vpn
- maximum prefix 100
parents:
- vrf VRF4
- address-family ipv4 unicast
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@
- no vrf VRF7
- no vrf test
register: result

- name: Remove RM policy
cisco.iosxr.iosxr_config:
lines:
- no route-policy rm-policy
- no route-policy rm-policy1
- no route-policy test-policy
register: result
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
msg: Start iosxr_vrf_address_family merged integration tests connection={{ ansible_connection}}

- ansible.builtin.include_tasks: _remove_config.yaml
- ansible.builtin.include_tasks: _populate.yaml
vars:
populate_init_config: false

- block:
- name: Merge provided configuration with device configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
- ansible.builtin.debug:
msg: START iosxr_vrf_address_family overridden integration tests on connection={{ ansible_connection }}

- ansible.builtin.include_tasks: _populate.yaml

- ansible.builtin.include_tasks: _remove_config.yaml
- ansible.builtin.include_tasks: _populate.yaml
vars:
populate_init_config: false

- block:
- name: Override the provided configuration with the existing running configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@
- name: GigabitEthernet0/0/0/2
vars:
ansible_connection: ansible.netcommon.network_cli

- name: Remove un-neccessary interfaces
cisco.iosxr.iosxr_config:
lines:
- no interface GigabitEthernet0/0/0/4.1
vars:
ansible_connection: ansible.netcommon.network_cli
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
- name: GigabitEthernet0/0/0/0
- name: GigabitEthernet0/0/0/1
vrf_name: vrf_C
- name: GigabitEthernet0/0/0/2
register: result

- name: Run show show running-config interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
- name: Assert that configuration was correctly parsed
ansible.builtin.assert:
that:
- merged['after'] == result['parsed']
- parsed['result'] == result['parsed']
17 changes: 10 additions & 7 deletions tests/integration/targets/iosxr_vrf_interfaces/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ gathered:
vrf_name: vrf_A
- name: GigabitEthernet0/0/0/2
vrf_name: vrf_B
- name: GigabitEthernet0/0/0/7
- name: TenGigE0/0/0/0

merged:
commands:
Expand All @@ -27,8 +25,6 @@ merged:
vrf_name: vrf_C
- name: GigabitEthernet0/0/0/2
vrf_name: vrf_D
- name: GigabitEthernet0/0/0/7
- name: TenGigE0/0/0/0

overridden:
commands:
Expand All @@ -43,9 +39,6 @@ overridden:
- name: GigabitEthernet0/0/0/0
- name: GigabitEthernet0/0/0/1
vrf_name: vrf_C
- name: GigabitEthernet0/0/0/2
- name: GigabitEthernet0/0/0/7
- name: TenGigE0/0/0/0
before:
- name: Loopback888
- name: Loopback999
Expand All @@ -55,5 +48,15 @@ overridden:
vrf_name: vrf_A
- name: GigabitEthernet0/0/0/2
vrf_name: vrf_B
parsed:
result:
- name: Loopback888
- name: Loopback999
- name: MgmtEth0/RP0/CPU0/0
- name: GigabitEthernet0/0/0/0
- name: GigabitEthernet0/0/0/1
vrf_name: vrf_C
- name: GigabitEthernet0/0/0/2
vrf_name: vrf_D
- name: GigabitEthernet0/0/0/7
- name: TenGigE0/0/0/0

0 comments on commit 769c0f5

Please sign in to comment.