Skip to content

Commit 48b3f5a

Browse files
AAYUSH2091AAYUSH2091pre-commit-ci[bot]
authored
Fix iosxr integration test failures (#571)
* fixing_inventory * Update multi.yaml * Update multi.yaml * Update multi.yaml * fixes_tests * Update main.yaml * chore: auto fixes from pre-commit.com hooks * removed_comment * fixed_import_error * fixed_parser * Update iosxr.py * Update iosxr.py * fixes_idempotent_issue * chore: auto fixes from pre-commit.com hooks * revert_last_commit * Update l3_interfaces.py * Update IOSXR topology removing multiple nodes (#574) * fixes_topology * chore: auto fixes from pre-commit.com hooks * Update multi.yaml * chore: auto fixes from pre-commit.com hooks * Update multi.yaml --------- Co-authored-by: AAYUSH2091 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fixing_inventory * Update multi.yaml * chore: auto fixes from pre-commit.com hooks * fix * Update multi.yaml * Update iosxr.py * chore: auto fixes from pre-commit.com hooks * Update iosxr.py * chore: auto fixes from pre-commit.com hooks * Update main.yaml * fixes_routes_maps * fixes_routes_maps_ * fixed_parser * minor_fixes * chore: auto fixes from pre-commit.com hooks * fixes_vrf_interfaces_test * fixed_vrf_interfaces * minor_fix * reverting_the_fix_for_fallback_logic * refined_lxml_import * remove_fallback_to_xml --------- Co-authored-by: AAYUSH2091 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b669c30 commit 48b3f5a

File tree

14 files changed

+81
-29
lines changed

14 files changed

+81
-29
lines changed

plugins/module_utils/network/iosxr/rm_templates/route_maps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,13 @@ def __init__(self, lines=None, module=None):
333333
"getval": re.compile(
334334
r"""
335335
\s*set\scommunity
336-
(\s(?P<community_name>.*))?
336+
(\s(?P<community_name>(.*?)))?
337337
(\s(?P<additive>additive))?
338338
$""", re.VERBOSE,
339339
),
340340
"setval": "set community"
341341
"{{ (' ' + set.community.community_name ) if set.community.community_name is defined else '' }}"
342-
"{{ (' additive' ) if set.community.additive is defined else '' }}",
342+
"{{ (' additive') if set.community.additive|d(False) else '' }}",
343343
"result": {
344344
"policies": {
345345
"set": {

tests/integration/targets/iosxr_l2_interfaces/tests/cli/_remove_config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- GigabitEthernet 0/0/0/3.900
99
- GigabitEthernet 0/0/0/4
1010
- GigabitEthernet0/0/0/4.1
11+
- GigabitEthernet0/0/0/5
1112
ignore_errors: true
1213
cisco.iosxr.iosxr_config:
1314
lines:

tests/integration/targets/iosxr_l2_interfaces/tests/cli/replaced.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
register: result
1212
cisco.iosxr.iosxr_l2_interfaces: &id001
1313
config:
14-
- name: GigabitEthernet0/0/0/1
14+
- name: GigabitEthernet0/0/0/4
1515
l2transport: true
1616
l2protocol:
1717
- cpsv: drop

tests/integration/targets/iosxr_l2_interfaces/vars/main.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,24 @@ replaced:
5555
l2transport: true
5656
name: GigabitEthernet0/0/0/4
5757
commands:
58-
- interface GigabitEthernet0/0/0/1
58+
- interface GigabitEthernet0/0/0/4
5959
- no l2transport
6060
- l2transport l2protocol cpsv drop
6161
after:
6262
- name: Loopback888
6363
- name: Loopback999
6464
- name: MgmtEth0/RP0/CPU0/0
6565
- l2protocol:
66-
- cpsv: drop
66+
- cpsv: tunnel
6767
l2transport: true
68+
propagate: true
6869
name: GigabitEthernet0/0/0/1
6970
- name: GigabitEthernet0/0/0/3.900
7071
encapsulation:
7172
dot1q: 40
7273
second_dot1q: 60
7374
- l2protocol:
74-
- cpsv: tunnel
75+
- cpsv: drop
7576
l2transport: true
7677
name: GigabitEthernet0/0/0/4
7778

@@ -140,3 +141,4 @@ deleted:
140141
- name: Loopback999
141142
- name: MgmtEth0/RP0/CPU0/0
142143
- name: GigabitEthernet0/0/0/3.900
144+
- name: GigabitEthernet0/0/0/4

tests/integration/targets/iosxr_lacp_interfaces/tests/cli/gathered.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
mac: 00c2.4c00.bd15
2020

2121
- name: GigabitEthernet0/0/0/1
22-
period: 100
22+
period: 200
2323
state: merged
2424

2525
- name: Gather interfaces facts using gathered state

tests/integration/targets/iosxr_lacp_interfaces/tests/cli/merged.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
mac: 00c2.4c00.bd15
2020

2121
- name: GigabitEthernet0/0/0/1
22-
period: 100
22+
period: 200
2323
state: merged
2424

2525
- name: Assert that before dicts were correctly generated

tests/integration/targets/iosxr_lacp_interfaces/vars/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ merged:
1111
- interface Bundle-Ether11
1212
- lacp system mac 00c2.4c00.bd15
1313
- interface GigabitEthernet0/0/0/1
14-
- lacp period 100
14+
- lacp period 200
1515
after:
1616
- name: Bundle-Ether10
1717
churn_logging: actor
@@ -22,7 +22,7 @@ merged:
2222
mac: 00c2.4c00.bd15
2323
- name: GigabitEthernet0/0/0/0
2424
- name: GigabitEthernet0/0/0/1
25-
period: 100
25+
period: 200
2626
populate:
2727
- name: Bundle-Ether10
2828
churn_logging: actor

tests/integration/targets/iosxr_route_maps/tests/common/_parsed.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
route-policy POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)
2+
set community (64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)
3+
set local-preference 150
4+
end-policy
5+
!
16
route-policy COMPLEX_ROUTE_POLICY
27
if destination in A_RANDOM_POLICY_DUMMY then
38
drop

tests/integration/targets/iosxr_route_maps/tests/common/merged.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@
5454
condition: community matches-any (9119:1001) or community matches-any (11100:1001)
5555
drop: true
5656
name: COMPLEX_CONDITION_ROUTE_POLICY
57+
- global:
58+
set:
59+
community:
60+
community_name: (64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)
61+
local_preference:
62+
- metric_number: 150
63+
name: POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)
5764
register: result
5865

5966
- name: Assert that before dicts were correctly generated

tests/integration/targets/iosxr_route_maps/vars/main.yaml

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ merged:
99
- "set extcommunity rt 65000:100 additive"
1010
- "set weight 20000"
1111
- "end-policy"
12+
- "route-policy POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)"
13+
- "set community (64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)"
14+
- "set local-preference 150\n"
15+
- "end-policy"
1216
- "route-policy SIMPLE_CONDITION_ROUTE_POLICY"
1317
- "if destination in SIMPLE_CONDITION_ROUTE_POLICY then"
1418
- "pass"
@@ -34,27 +38,34 @@ merged:
3438
- "endif"
3539
- "end-policy"
3640
after:
41+
- global:
42+
set:
43+
community:
44+
community_name: "(64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)"
45+
local_preference:
46+
- metric_number: 150
47+
name: "POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)"
3748
- else_section:
3849
else_section:
3950
drop: true
4051
if_section:
41-
condition: destination in A_RANDOM_POLICY
52+
condition: "destination in A_RANDOM_POLICY"
4253
pass: true
4354
if_section:
44-
condition: destination in A_RANDOM_POLICY_DUMMY
55+
condition: "destination in A_RANDOM_POLICY_DUMMY"
4556
drop: true
46-
name: COMPLEX_ROUTE_POLICY
57+
name: "COMPLEX_ROUTE_POLICY"
4758
- global:
4859
apply:
49-
- route_policy: A_NEW_ROUTE_POLICY
60+
- route_policy: "A_NEW_ROUTE_POLICY"
5061
set:
5162
community:
5263
additive: true
53-
community_name: (11011:1001)
64+
community_name: "(11011:1001)"
5465
med:
5566
value: 100
5667
extcommunity:
57-
rt: 65000:100
68+
rt: "65000:100"
5869
additive: true
5970
weight: 20000
6071
local_preference:
@@ -64,21 +75,21 @@ merged:
6475
metric_number: 200
6576
- multiply: true
6677
metric_number: 300
67-
name: SIMPLE_GLOBAL_ROUTE_POLICY
78+
name: "SIMPLE_GLOBAL_ROUTE_POLICY"
6879
- else_section:
6980
global:
7081
drop: true
7182
if_section:
72-
condition: destination in SIMPLE_CONDITION_ROUTE_POLICY
83+
condition: "destination in SIMPLE_CONDITION_ROUTE_POLICY"
7384
pass: true
74-
name: SIMPLE_CONDITION_ROUTE_POLICY
85+
name: "SIMPLE_CONDITION_ROUTE_POLICY"
7586
- else_section:
7687
global:
7788
pass: true
7889
if_section:
79-
condition: community matches-any (9119:1001) or community matches-any (11100:1001)
90+
condition: "community matches-any (9119:1001) or community matches-any (11100:1001)"
8091
drop: true
81-
name: COMPLEX_CONDITION_ROUTE_POLICY
92+
name: "COMPLEX_CONDITION_ROUTE_POLICY"
8293

8394
overridden:
8495
commands:
@@ -100,6 +111,7 @@ overridden:
100111
- endif
101112
- endif
102113
- end-policy
114+
- no route-policy POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)
103115
- no route-policy COMPLEX_ROUTE_POLICY
104116
- no route-policy SIMPLE_GLOBAL_ROUTE_POLICY
105117
- no route-policy SIMPLE_CONDITION_ROUTE_POLICY
@@ -134,6 +146,13 @@ overridden:
134146
metric_number: 300
135147
name: SIMPLE_GLOBAL_ROUTE_POLICY_overridden
136148
before:
149+
- global:
150+
set:
151+
community:
152+
community_name: (64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)
153+
local_preference:
154+
- metric_number: 150
155+
name: POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)
137156
- else_section:
138157
else_section:
139158
drop: true
@@ -216,6 +235,13 @@ rendered:
216235

217236
deleted:
218237
after:
238+
- global:
239+
set:
240+
community:
241+
community_name: "(64496:100, 64496:$SPECIFICITY, 64496:$GEO_LOCATION, 65012:174)"
242+
local_preference:
243+
- metric_number: 150
244+
name: POLICY_TWO_PARAMS($SPECIFICITY, $GEO_LOCATION)
219245
- global:
220246
apply:
221247
- route_policy: A_NEW_ROUTE_POLICY

0 commit comments

Comments
 (0)