Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ansible/roles/test/tasks/crm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
when: (testbed_type is not defined)

- fail: msg="Invalid testbed_type value '{{testbed_type}}'"
when: testbed_type not in ['t1', 't1-lag', 't0']
when: testbed_type not in ['t1', 't1-lag', 't0', 't0-56', 't0-64', 't0-116']

- set_fact: crm_intf="{{minigraph_interfaces[0].attachto}}"
crm_intf1="{{minigraph_interfaces[2].attachto}}"
when: testbed_type == "t1"

- set_fact: crm_intf="{{minigraph_portchannel_interfaces[0].attachto}}"
when: (testbed_type == "t0") or (testbed_type == "t1-lag")
crm_intf1="{{minigraph_portchannel_interfaces[2].attachto}}"
when: testbed_type in ['t0', 't1-lag', 't0-56', 't0-64', 't0-116']

- set_fact:
ansible_date_time: "{{ansible_date_time}}"
Expand Down
9 changes: 7 additions & 2 deletions ansible/roles/test/tasks/crm/crm_test_ipv4_route.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
register: out
- set_fact: crm_stats_ipv4_route_available={{out.stdout}}

- name: Get NH IP
command: ip -4 neigh show dev {{crm_intf}}
register: out
- set_fact: nh_ip="{{out.stdout.split()[0]}}"

- name: Add IPv4 route
command: ip route add 2.2.2.0/24 via 10.0.0.57
command: ip route add 2.2.2.0/24 via {{nh_ip}}
become: yes

- name: Make sure CRM counters updated
Expand All @@ -34,7 +39,7 @@
assert: {that: "{{crm_stats_ipv4_route_available|int - new_crm_stats_ipv4_route_available|int >= 1}}"}

- name: Remove IPv4 route
command: ip route del 2.2.2.0/24 via 10.0.0.57
command: ip route del 2.2.2.0/24 via {{nh_ip}}
become: yes

- name: Make sure CRM counters updated
Expand Down
9 changes: 7 additions & 2 deletions ansible/roles/test/tasks/crm/crm_test_ipv6_route.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
register: out
- set_fact: crm_stats_ipv6_route_available={{out.stdout}}

- name: Get NH IP
command: ip -6 neigh show dev {{crm_intf}}
register: out
- set_fact: nh_ip="{{out.stdout.split()[0]}}"

- name: Add IPv6 route
command: ip -6 route add 2001::/126 via fc00::72
command: ip -6 route add 2001::/126 via {{nh_ip}}
become: yes

- name: Make sure CRM counters updated
Expand All @@ -34,7 +39,7 @@
assert: {that: "{{crm_stats_ipv6_route_available|int - new_crm_stats_ipv6_route_available|int == 1}}"}

- name: Remove IPv6 route
command: ip -6 route del 2001::/126 via fc00::72
command: ip -6 route del 2001::/126 via {{nh_ip}}
become: yes

- name: Make sure CRM counters updated
Expand Down
14 changes: 12 additions & 2 deletions ansible/roles/test/tasks/crm/crm_test_nexthop_group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@
register: out
- set_fact: crm_stats_nexthop_group_available={{out.stdout}}

- name: Get NH IP 1
command: ip -4 neigh show dev {{crm_intf}}
register: out
- set_fact: nh_ip1="{{out.stdout.split()[0]}}"

- name: Get NH IP 2
command: ip -4 neigh show dev {{crm_intf1}}
register: out
- set_fact: nh_ip2="{{out.stdout.split()[0]}}"

- name: Add nexthop group
command: ip route add 2.2.2.0/24 nexthop via 10.0.0.57 nexthop via 10.0.0.59
command: ip route add 2.2.2.0/24 nexthop via {{nh_ip1}} nexthop via {{nh_ip2}}
become: yes

- name: Make sure CRM counters updated
Expand All @@ -34,7 +44,7 @@
assert: {that: "{{crm_stats_nexthop_group_available|int - new_crm_stats_nexthop_group_available|int >= 1}}"}

- name: Remove nexthop group
command: ip route del 2.2.2.0/24 nexthop via 10.0.0.57 nexthop via 10.0.0.59
command: ip route del 2.2.2.0/24 nexthop via {{nh_ip1}} nexthop via {{nh_ip2}}
become: yes

- name: Make sure CRM counters updated
Expand Down
14 changes: 12 additions & 2 deletions ansible/roles/test/tasks/crm/crm_test_nexthop_group_member.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@
register: out
- set_fact: crm_stats_nexthop_group_member_available={{out.stdout}}

- name: Get NH IP 1
command: ip -4 neigh show dev {{crm_intf}}
register: out
- set_fact: nh_ip1="{{out.stdout.split()[0]}}"

- name: Get NH IP 2
command: ip -4 neigh show dev {{crm_intf1}}
register: out
- set_fact: nh_ip2="{{out.stdout.split()[0]}}"

- name: Add nexthop group members
command: ip route add 2.2.2.0/24 nexthop via 10.0.0.57 nexthop via 10.0.0.59
command: ip route add 2.2.2.0/24 nexthop via {{nh_ip1}} nexthop via {{nh_ip2}}
become: yes

- name: Make sure CRM counters updated
Expand All @@ -34,7 +44,7 @@
assert: {that: "{{crm_stats_nexthop_group_member_available|int - new_crm_stats_nexthop_group_member_available|int == 2}}"}

- name: Remove nexthop group members
command: ip route del 2.2.2.0/24 nexthop via 10.0.0.57 nexthop via 10.0.0.59
command: ip route del 2.2.2.0/24 nexthop via {{nh_ip1}} nexthop via {{nh_ip2}}
become: yes

- name: Make sure CRM counters updated
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/test/vars/testcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ testcases:

crm:
filename: crm.yml
topologies: [t1, t1-lag, t0]
topologies: [t1, t1-lag, t0, t0-56, t0-64, t0-116]