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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
session_gre: "0x8949"
when: sonic_hwsku in mellanox_hwskus

- debug: msg="session name {{ session_name }}"
- debug: msg=session name {{ session_name }}

- set_fact:
addr_1: "{{ session_dst_ip }}/24"
Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/test/tasks/everflow_testbed/run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
minigraph_facts: host={{ inventory_hostname }}

- name: Print neighbors in minigraph
debug: msg="{{ minigraph_neighbors }}"
debug: msg={{ minigraph_neighbors }}

- set_fact:
testname: everflow_testbed
Expand Down Expand Up @@ -44,7 +44,7 @@
delegate_to: "{{ ptf_host }}"

- name: Add route to unresolved next hop.
shell: ip route add {{ unresolved_nexthop_prefix }} dev {{ dst_port_2 }}
shell: vtysh -e "conf t" -e "ip route {{ unresolved_nexthop_prefix }} {{ dst_port_2 }}"
become: yes

- name: Run testcase 1 - Resolved route
Expand Down Expand Up @@ -74,7 +74,7 @@

always:
- name: Remove route to unresolved next hop.
shell: ip route del {{ unresolved_nexthop_prefix }}
shell: vtysh -e "conf t" -e "no ip route {{ unresolved_nexthop_prefix }} {{ dst_port_2 }}"
become: yes

- include: roles/test/files/tools/loganalyzer/loganalyzer_analyze.yml
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/test/tasks/everflow_testbed/testcase_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Verify that session with resolved route has active state.

- name: Create route with next hop {{ dst_port_1 }}.
shell: ip route add {{ session_prefix_1 }} via {{ neighbor_info_1['addr'] }}
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}"
become: yes

- block:
Expand All @@ -15,5 +15,5 @@

always:
- name: Remove route
shell: ip route del {{ session_prefix_1 }}
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}"
become: yes
14 changes: 9 additions & 5 deletions ansible/roles/test/tasks/everflow_testbed/testcase_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

- block:
- name: Create route with next hop on {{ dst_port_1 }}.
shell: ip route add {{ session_prefix_1 }} via {{ neighbor_info_1['addr'] }}
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on destination port {{ dst_port_1 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -13,7 +13,7 @@
register: out

- name: Create route with best match and unresolved next hop.
shell: ip route add {{ session_prefix_2 }} via {{ unresolved_nexthop }}
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_2 }} {{ unresolved_nexthop }}"

- name: Send traffic and verify that packets with correct Everflow header are received on destination port {{ dst_port_1 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -23,7 +23,7 @@
register: out

- name: Create route with best match prefix and resolved next hop on destination port {{ dst_port_2 }}.
shell: ip route change {{ session_prefix_2 }} via {{ neighbor_info_2['addr'] }}
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_2 }} {{ unresolved_nexthop }}" -e "ip route {{ session_prefix_2 }} {{ neighbor_info_2['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on destination port {{ dst_port_2 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_2_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -35,10 +35,14 @@

always:
- name: Remove route.
shell: ip route del {{ session_prefix_1 }}
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}"
ignore_errors: yes

- name: Remove best match route.
shell: ip route del {{ session_prefix_2 }}
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_2 }} {{ unresolved_nexthop }}"
ignore_errors: yes

- name: Remove best match route.
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_2 }} {{ neighbor_info_2['addr'] }}"
ignore_errors: yes
become: yes
11 changes: 5 additions & 6 deletions ansible/roles/test/tasks/everflow_testbed/testcase_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

- block:
- name: Create route with next hop on {{ dst_port_1 }}.
shell: ip route add {{ session_prefix_1 }} via {{ neighbor_info_1['addr'] }}
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on destination port {{ dst_port_1 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -13,7 +13,7 @@
register: out

- name: Create route with best match prefix and resolved next hop {{ dst_port_2 }}.
shell: ip route add {{ session_prefix_2 }} via {{ neighbor_info_2['addr'] }}
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_2 }} {{ neighbor_info_2['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on destination port {{ dst_port_2}}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_2_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -23,8 +23,7 @@
register: out

- name: Remove best match route.
shell: ip route del {{ session_prefix_2 }}
ignore_errors: yes
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_2 }} {{ neighbor_info_2['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on destination port {{ dst_port_1 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -36,10 +35,10 @@

always:
- name: Remove route.
shell: ip route del {{ session_prefix_1 }}
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}"
ignore_errors: yes

- name: Remove best match route.
shell: ip route del {{ session_prefix_2 }}
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_2 }} {{ neighbor_info_2['addr'] }}"
ignore_errors: yes
become: yes
4 changes: 2 additions & 2 deletions ansible/roles/test/tasks/everflow_testbed/testcase_4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

- block:
- name: Create route with next hop on {{ dst_port_1 }}.
shell: ip route add {{ session_prefix_1 }} via {{ neighbor_info_1['addr'] }}
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on destination port {{ dst_port_1 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";expected_dst_mac="{{ neighbor_mac_1 }}";verbose=True'
Expand Down Expand Up @@ -31,6 +31,6 @@
shell: ping {{ neighbor_info_1['addr'] }} -c3

- name: Remove route.
shell: ip route del {{ session_prefix_1 }}
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}"
ignore_errors: yes
become: yes
4 changes: 2 additions & 2 deletions ansible/roles/test/tasks/everflow_testbed/testcase_5.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Test case 5 - Resolved ECMP route.

- name: Create ECMP route with next hops on {{ dst_port_1 }} and {{ dst_port_2 }}.
shell: ip route add {{ session_prefix_1 }} nexthop via {{ neighbor_info_1['addr'] }} via {{ neighbor_info_2['addr'] }}
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_2['addr'] }}"
become: yes

- block:
Expand All @@ -14,5 +14,5 @@

always:
- name: Remove route
shell: ip route del {{ session_prefix_1 }}
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_2['addr'] }}"
become: yes
33 changes: 26 additions & 7 deletions ansible/roles/test/tasks/everflow_testbed/testcase_6.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Test case 6 - ECMP route change (add next hop).
# Verify that insertion of additional next hop to ECMP group doesn't affects session DST MAC and port.
# Test case 8 - ECMP route change (remove next hop not used by session).
# Verify that after removal of next hop that was used by session from ECMP route session state is active.

- block:
- name: Create ECMP route with next hops on {{ dst_port_1 }} and {{ dst_port_2 }}.
shell: ip route add {{ session_prefix_1 }} nexthop via {{ neighbor_info_1['addr'] }} via {{ neighbor_info_2['addr'] }}
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_2['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on {{ dst_port_1 }} or {{ dst_port_2 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}, {{ dst_port_2_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -12,8 +12,26 @@
delegate_to: "{{ ptf_host }}"
register: out

- name: Add next hop on {{ dst_port_3 }} to ECMP route.
shell: ip route change {{ session_prefix_1 }} nexthop via {{ neighbor_info_1['addr'] }} via {{ neighbor_info_2['addr'] }} via {{ neighbor_info_3['addr'] }}
- name: Add next hop to ECMP route.
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_3['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on {{ dst_port_1 }} or {{ dst_port_2 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}, {{ dst_port_2_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
args:
chdir: /root
delegate_to: "{{ ptf_host }}"
register: out

- name: Send traffic and verify that packets are not received on {{ dst_port_3 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_3_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
args:
chdir: /root
delegate_to: "{{ ptf_host }}"
register: out
failed_when: out.rc == 0

- name: Delete next hop from ECMP route.
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_3['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on {{ dst_port_1 }} or {{ dst_port_2 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}, {{ dst_port_2_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -33,5 +51,6 @@

always:
- name: Remove route
shell: ip route del {{ session_prefix_1 }}
become: yes
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_2['addr'] }}" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_3['addr'] }}"
ignore_errors: yes
become: yes
15 changes: 8 additions & 7 deletions ansible/roles/test/tasks/everflow_testbed/testcase_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

- block:
- name: Create route with next hop on {{ dst_port_1 }}.
shell: ip route add {{ session_prefix_1 }} nexthop via {{ neighbor_info_1['addr'] }}
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on {{ dst_port_1 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -13,7 +13,7 @@
register: out

- name: Add next hops on {{ dst_port_2 }} and {{ dst_port_3 }} to route.
shell: ip route change {{ session_prefix_1 }} nexthop via {{ neighbor_info_1['addr'] }} via {{ neighbor_info_2['addr'] }} via {{ neighbor_info_3['addr'] }}
shell: vtysh -e "conf t" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_2['addr'] }}" -e "ip route {{ session_prefix_1 }} {{ neighbor_info_3['addr'] }}"

- name: Send traffic and verify that packets with correct Everflow header are received on {{ dst_port_1 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -30,8 +30,8 @@
register: out
failed_when: out.rc == 0

- name: Delete next hop from ECMP route.
shell: ip route change {{ session_prefix_1 }} nexthop via {{ neighbor_info_2['addr'] }} via {{ neighbor_info_3['addr'] }}
- name: Delete one next hop from ECMP route.
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}"

- name: Send traffic and verify that packets are not received {{ dst_port_1 }}.
shell: ptf --test-dir acstests everflow_tb_test.EverflowTest --platform-dir ptftests --platform remote -t 'asic_type="{{ sonic_asic_type }}";hwsku="{{ sonic_hwsku }}";router_mac="{{ ansible_Ethernet0['macaddress'] }}";src_port="{{ src_port_ptf_id }}";dst_ports="{{ dst_port_1_ptf_id }}";session_src_ip="{{ session_src_ip }}";session_dst_ip="{{ session_dst_ip }}";session_ttl="{{ session_ttl }}";session_dscp="{{ session_dscp }}";verbose=True'
Expand All @@ -50,6 +50,7 @@
become: yes

always:
- name: Remove route
shell: ip route del {{ session_prefix_1 }}
become: yes
- name: Remove route {{session_prefix_1}}
shell: vtysh -e "conf t" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_1['addr'] }}" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_2['addr'] }}" -e "no ip route {{ session_prefix_1 }} {{ neighbor_info_3['addr'] }}"
ignore_errors: yes
become: yes
Loading