-
Notifications
You must be signed in to change notification settings - Fork 999
Test case 1 of PFC watchdog against warm-reboot: happy path #825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
571f5fd
First test case of PFC watchdog against warm-reboot
wendani 54d9abc
Add more comments for code readability
wendani 6759431
Merge remote-tracking branch 'public/master' into pfcwd_wb_master
wendani 252eea0
Merge remote-tracking branch 'public/master' into pfcwd_wb_master
wendani 4558d64
Use boolean variable to determine the test run type: regular pfc wd test
wendani 7f881a3
Feed reboot type to reboot_sonic.yml in warm-reboot happy path test
wendani 7793a95
Merge remote-tracking branch 'public/master' into pfcwd_wb_master
wendani 863d6d4
Merge remote-tracking branch 'public/master' into pfcwd_wb_master
wendani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
142 changes: 142 additions & 0 deletions
142
ansible/roles/test/tasks/pfc_wd/functional_test/functional_test_restore.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| #------------------------------------ | ||
| # Test the PFC restore action | ||
| # 1. Verify restore is detected via syslog entry analysis on the dut | ||
| # 2. Verity the forward action on both ingress and egress via ptf dataplane traffic test | ||
| #------------------------------------ | ||
|
|
||
| - name: Set fact for item values | ||
| set_fact: | ||
| peer_device: "{{item.value.peer_device}}" | ||
| pfc_wd_test_port: "{{item.key}}" | ||
| pfc_wd_rx_port: "{{item.value.rx_port}}" | ||
| pfc_wd_test_neighbor_addr: "{{item.value.test_neighbor_addr}}" | ||
| pfc_wd_rx_neighbor_addr: "{{item.value.rx_neighbor_addr}}" | ||
| pfc_wd_test_port_id: "{{item.value.test_port_id}}" | ||
| pfc_wd_rx_port_id: "{{item.value.rx_port_id}}" | ||
| port_type: "{{item.value.test_port_type}}" | ||
|
|
||
| - name: Set fact for test port ids and include portchannel other members if exists | ||
| set_fact: | ||
| pfc_wd_test_port_ids: "[{{item.value.test_portchannel_members | join(' ')}}]" | ||
| when: port_type == "portchannel" | ||
|
|
||
| - set_fact: | ||
| pfc_wd_test_port_ids: "[{{pfc_wd_test_port_id}}]" | ||
| when: port_type in ["vlan", "interface"] | ||
|
|
||
| - name: Remove existing IPs from PTF host | ||
| script: roles/test/files/helpers/remove_ip.sh | ||
| delegate_to: "{{ptf_host}}" | ||
| when: port_type == "vlan" | ||
|
|
||
| - name: "Set {{pfc_wd_test_neighbor_addr}} to eth{{pfc_wd_test_port_id}} on PTF host" | ||
| shell: ifconfig eth{{pfc_wd_test_port_id}} {{pfc_wd_test_neighbor_addr}} | ||
| delegate_to: "{{ptf_host}}" | ||
| when: port_type == "vlan" | ||
|
|
||
| - name: "Update ARP entry on DUT" | ||
| shell: ping {{minigraph_vlan_interfaces[0]['addr']}} -c 10 | ||
| delegate_to: "{{ptf_host}}" | ||
| when: port_type == "vlan" | ||
|
|
||
| - name: "Update ARP entry on DUT" | ||
| shell: docker exec -i swss arping {{pfc_wd_test_neighbor_addr}} -c 5 | ||
| when: port_type == "vlan" | ||
|
|
||
| - conn_graph_facts: host={{ peer_device }} | ||
| connection: local | ||
| become: no | ||
|
|
||
| - name: Prepare variables required for PFC test | ||
| set_fact: | ||
| pfc_queue_index: 4 | ||
| pfc_frames_number: 100000000 | ||
| pfc_wd_test_pkt_count: 100 | ||
| pfc_fanout_interface: "{{neighbors[pfc_wd_test_port]['peerport']}}" | ||
| peer_hwsku: "{{device_info['HwSku']}}" | ||
| peer_mgmt: "{{device_info['mgmtip']}}" | ||
| testname: functional_test | ||
|
|
||
| - set_fact: | ||
| class_enable: "{{(1).__lshift__(pfc_queue_index)}}" | ||
|
|
||
| - set_fact: | ||
| peer_login: "{{switch_login[hwsku_map[peer_hwsku]]}}" | ||
|
|
||
| - name: set pfc storm templates based on fanout platform sku | ||
| include: roles/test/tasks/pfc_wd/functional_test/set_pfc_storm_templates.yml | ||
|
|
||
|
|
||
| - block: | ||
| # 1. Verify restore is detected via syslog entry analysis on the dut | ||
| - set_fact: | ||
| test_expect_file: "expect_pfc_wd_restore" | ||
|
|
||
| - name: Initialize loganalyzer | ||
| include: roles/test/files/tools/loganalyzer/loganalyzer_init.yml | ||
|
|
||
| - name: Stop PFC storm on fanout switch | ||
| action: apswitch template="{{pfc_wd_storm_stop_template}}" | ||
| args: | ||
| host: "{{peer_mgmt}}" | ||
| login: "{{peer_login}}" | ||
| connection: switch | ||
|
|
||
| - name: Wait for queue to recover from PFC storm | ||
| pause: | ||
| seconds: 1 | ||
|
|
||
| - name: Check if logs contain message that PFC WD restored from deadlock | ||
| include: roles/test/files/tools/loganalyzer/loganalyzer_analyze.yml | ||
|
|
||
| - name: Check if logs contain message that PFC WD restored from deadlock | ||
| include: roles/test/files/tools/loganalyzer/loganalyzer_end.yml | ||
|
|
||
| # 2. Verity the forward action on both ingress and egress via ptf dataplane traffic test | ||
| - name: "Send packets via {{pfc_wd_test_port}}" | ||
| include: roles/test/tasks/ptf_runner.yml | ||
| vars: | ||
| ptf_test_name: PFC WD test | ||
| ptf_test_dir: ptftests | ||
| ptf_test_path: pfc_wd.PfcWdTest | ||
| ptf_platform: remote | ||
| ptf_platform_dir: ptftests | ||
| ptf_test_params: | ||
| - testbed_type='{{testbed_type}}' | ||
| - router_mac='{{ansible_ethernet0_mac_addr}}' | ||
| - queue_index='{{pfc_queue_index}}' | ||
| - pkt_count='{{pfc_wd_test_pkt_count}}' | ||
| - port_src='{{pfc_wd_rx_port_id[0]}}' | ||
| - port_dst='{{pfc_wd_test_port_ids}}' | ||
| - ip_dst='{{pfc_wd_test_neighbor_addr}}' | ||
| - port_type='{{port_type}}' | ||
| - wd_action='forward' | ||
| ptf_extra_options: "--relax --debug info --log-file /tmp/pfc_wd.PfcWdTest.{{lookup('pipe','date +%Y-%m-%d-%H:%M:%S')}}.log " | ||
|
|
||
| - name: "Send packets to {{pfc_wd_test_port}}" | ||
| include: roles/test/tasks/ptf_runner.yml | ||
| vars: | ||
| ptf_test_name: PFC WD test | ||
| ptf_test_dir: ptftests | ||
| ptf_test_path: pfc_wd.PfcWdTest | ||
| ptf_platform: remote | ||
| ptf_platform_dir: ptftests | ||
| ptf_test_params: | ||
| - testbed_type='{{testbed_type}}' | ||
| - router_mac='{{ansible_ethernet0_mac_addr}}' | ||
| - queue_index='{{pfc_queue_index}}' | ||
| - pkt_count='{{pfc_wd_test_pkt_count}}' | ||
| - port_src='{{pfc_wd_test_port_id}}' | ||
| - port_dst='[{{pfc_wd_rx_port_id | join(' ')}}]' | ||
| - ip_dst='{{pfc_wd_rx_neighbor_addr}}' | ||
| - port_type='{{port_type}}' | ||
| - wd_action='forward' | ||
| ptf_extra_options: "--relax --debug info --log-file /tmp/pfc_wd.PfcWdTest.{{lookup('pipe','date +%Y-%m-%d-%H:%M:%S')}}.log " | ||
|
|
||
| rescue: | ||
| - name: Stop PFC storm on fanout switch | ||
| action: apswitch template="{{pfc_wd_storm_stop_template}}" | ||
| args: | ||
| host: "{{peer_mgmt}}" | ||
| login: "{{peer_login}}" | ||
| connection: switch | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.