-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into macsec_verify_hook
- Loading branch information
Showing
18 changed files
with
480 additions
and
81 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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,5 @@ | ||
--- | ||
# mapping from testbed name to nic simulator gRPC binding port | ||
|
||
nic_simulator_grpc_port: | ||
vms-kvm-dual-mixed: 8900 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,86 @@ | ||
--- | ||
- name: Start nic simulator | ||
block: | ||
|
||
- name: Get absolute path of {{ root_path }} | ||
command: "realpath {{ root_path }}" | ||
register: real_root_path | ||
|
||
- name: Set variable abs_root_path | ||
set_fact: | ||
abs_root_path: "{{ real_root_path.stdout }}" | ||
|
||
- name: Set nic simulator binding port | ||
set_fact: | ||
nic_simulator_port: "{{ nic_simulator_grpc_port[testbed_name] }}" | ||
|
||
- name: Set network namespace path | ||
set_fact: | ||
netns_name: "{{ 'ns-' + vm_set_name }}" | ||
|
||
- name: Find ip command absolute path | ||
shell: which ip | ||
register: which_ip_output | ||
|
||
- name: Set ip command absolute path | ||
set_fact: | ||
ip_command_path: "{{ which_ip_output.stdout }}" | ||
|
||
- name: Install pip3 | ||
apt: | ||
name: python3-pip | ||
state: present | ||
become: yes | ||
when: host_distribution_version.stdout == "18.04" | ||
|
||
- name: Set Python version | ||
set_fact: | ||
python_command: "python3" | ||
pip_command: "pip3" | ||
|
||
- name: Install gRPC library | ||
pip: | ||
name: | ||
- grpcio | ||
- grpcio-tools | ||
executable: "{{ pip_command }}" | ||
become: yes | ||
environment: "{{ proxy_env | default({}) }}" | ||
|
||
- name: Set nic simulator source directory | ||
set_fact: | ||
nic_simulator_dir: "{{ (playbook_dir, 'dualtor', 'nic_simulator') | path_join }}" | ||
|
||
- name: Copy nic simulator to test server | ||
copy: | ||
src: "{{ nic_simulator_dir }}" | ||
dest: "{{ abs_root_path }}" | ||
force: yes | ||
|
||
- name: Generate nic simulator systemd service file | ||
template: | ||
src: nic-simulator.service.j2 | ||
dest: /etc/systemd/system/nic-simulator-{{ vm_set_name }}.service | ||
become: yes | ||
|
||
- name: Start the nic-simulator service for testbed {{ testbed_name }} | ||
systemd: | ||
name: nic-simulator-{{ vm_set_name }} | ||
state: started | ||
daemon_reload: yes | ||
become: yes | ||
|
||
when: nic_simulator_action == "start" | ||
|
||
- name: Stop nic simulator | ||
block: | ||
|
||
- name: Stop the nic-simulator service for testbed {{ testbed_name }} | ||
systemd: | ||
name: nic-simulator-{{ vm_set_name }} | ||
state: stopped | ||
become: yes | ||
ignore_errors: yes | ||
|
||
|
||
when: nic_simulator_action == "stop" |
This file contains 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
This file contains 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
This file contains 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,6 @@ | ||
[Unit] | ||
Description=nic simulator | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart={{ ip_command_path }} netns exec {{ netns_name }} /usr/bin/env {{ python_command }} {{ abs_root_path }}/nic_simulator/nic_simulator.py -p {{ nic_simulator_port }} -v {{ vm_set_name }} -l debug |
This file contains 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,73 @@ | ||
# **VOQ Chassis Fabric Test Plan** | ||
|
||
- [Introduction](#introduction) | ||
- [Scope](#scope) | ||
- [Assumptions](#assumptions) | ||
- [Test Setup](#test-setup) | ||
- [Test Cases](#test-cases) | ||
|
||
# Introduction | ||
|
||
This is the test plan for Fabric link testing on SONIC Distributed VOQ System, as described in the [VOQ Fabric HLD](https://github.com/Azure/SONiC/blob/master/doc/voq/fabric.md) | ||
|
||
## Scope | ||
|
||
The scope of this test plan is as follows: | ||
* Check if all the expected fabric links are up. | ||
* Check if the fabric counters work correctly when there is data traffic. | ||
* Check if the fabric devices can reach all of the forwarding ASICs of the chassis (reachability) | ||
|
||
## Assumptions | ||
|
||
The current SW design for fabric does not cover events like card insertion/removal or reboots. This test plan depends on fabric counter cli support (work in progress). | ||
|
||
# Test Setup | ||
|
||
These test cases will be run in the proposed [T2 topology](https://github.com/Azure/sonic-mgmt/blob/master/ansible/vars/topo_t2.yml). It is assumed that such a configuration is deployed on the chassis. | ||
|
||
tbinfo will be populated with the number of fabric links per forwarding ASIC that are expected to be up. | ||
|
||
# Test Cases | ||
|
||
## Test Case 1. Test Fabric connectivity | ||
|
||
### Test Objective | ||
Verify that when the chassis is up and running, the fabric links that are expected to be up are up. | ||
|
||
### Test Steps | ||
* For each ASIC in the chassis (across different duts), run `show fabric counters port -n <asic_name>` | ||
|
||
### Pass/Fail Criteria | ||
* Verify for each ASIC, the number of links that are up matches the number of links per ASIC defined in the inventory. This is expected to be stored in the host_var attribute. | ||
|
||
## Test Case 2. Test fabric reachability | ||
|
||
### Test Objective | ||
Verify that from each fabric ASIC, all forwarding ASICs are reachable. | ||
|
||
### Test Steps | ||
* Run `show fabric reachability -n asicN` for each fabric ASIC | ||
|
||
### Pass/Fail Criteria | ||
* Verify for each fabric ASIC, all the forwarding ASICs in the chassis are reachable and the switch ID matches the expected switch ID. | ||
|
||
## Test Case 3. Test fabric counters under traffic | ||
|
||
### Test Objective | ||
Verify that under data traffic, all fabric links from an ASIC are utilized. The assumption is that the chassis architecture supports distributing data traffic across all fabric links. | ||
|
||
Note that there may be some internal communication such as intra-chassis BGP, which means that the validation cannot strictly confirm exact match between ingress and egress traffic counts. | ||
Instead, we will validate that the RX counts on the ASIC receiving traffic from the fabric are greater than or equal to the TX counts on the ASIC sending into the fabric. | ||
|
||
### Test Steps | ||
* Send a fixed number of packets traversing two ASICs | ||
* Run `show fabric counters port -n asicN` for the ingress and egress ASIC. | ||
|
||
Repeat the above test for the following packet sizes (bytes): 64, 256, 1512, 9000 | ||
|
||
### Pass/Fail Criteria | ||
* Verify on the ingress ASIC that all fabric links have non-zero value for TX fabric data unit counter. | ||
* Verify on the egress ASIC that all fabric links have non-zero value for RX fabric data unit counters. | ||
* Verify that the RX fabric data unit counters are not less than the TX counters. | ||
* Verify that there are no increments in error counters. | ||
|
This file contains 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
Oops, something went wrong.