Skip to content

Commit

Permalink
adjust the case numbers and vlan id
Browse files Browse the repository at this point in the history
Signed-off-by: richardyu-ms <[email protected]>
  • Loading branch information
richardyu-ms committed Jun 19, 2022
1 parent 08c90dc commit 0c53ec5
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 76 deletions.
21 changes: 11 additions & 10 deletions doc/sai-ptf/config_data/config_t0.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ In this configuration, we mapped the IP and MAC address into different parts of
For MAC addresses, we can use different sections in the MAC addresses to map different title numbers.
The pattern is
```
L1_NUM:L2_NUM:L3_NUM:ROLE:EXTRA:SEQ
00:TITLE_L1_NUM:TITLE_L2_NUM:ROLE:EXTRA:SEQ
ROLE: T1=1, Server=99
```

For example:
For the MAC address in ``1.1 FDB Configuration``.
For the MAC address in ``1.1 FDB Configuration``.
`1.1` is the title number.
```
#Server MAC
01:01:00:99:02:01~01:01:00:99:02:32
00:01:01:99:02:01~00:01:01:99:02:32
# 99: Server
# 02: EXTRA (Group ID)
```
Expand All @@ -49,7 +50,7 @@ Format: ROLE.NUM.GROUP_ID.SEQ

- ROLE_NUM
T0: 10.0.0.0
T1: 10.0.0.0
T1: 10.1.0.0
Server: 192.168.0.0

For example
Expand All @@ -73,8 +74,8 @@ The MAC Table for VLAN L2 forwarding as below
|Name|MAC|PORT|VLAN|HostIf|
|-|-|-|-|-|
|mac0|01:01:00:99:00:00|Port0||Ethernet0|
|mac1-8 |01:01:00:99:01:01 - 01:01:00:99:01:08|Port1-8|10|Ethernet4-Ethernet32|
|mac9-16 |01:01:00:99:02:09 - 01:01:00:99:02:16|Port9-16|20|Ethernet36-Ethernet64|
|mac1-8 |00:01:01:99:01:01 - 00:01:01:99:01:08|Port1-8|10|Ethernet4-Ethernet32|
|mac9-16 |00:01:01:99:02:09 - 00:01:01:99:02:16|Port9-16|20|Ethernet36-Ethernet64|

## 1.2 VLAN configuration

Expand Down Expand Up @@ -135,13 +136,13 @@ SAI_NATIVE_HASH_FIELD_L4_SRC_PORT
### 2.4.1 VLAN Neighbors
|Name|Port|IP|dest_mac|
|-|-|-|-|
|vlan10_nb1-nb8|Port1-8 |192.168.1.1 ~ 192.168.1.8 |01:01:00:99:01:01 - 01:01:00:99:01:08|
|vlan20_nb1-nb8|Port9-16|192.168.2.9 ~ 192.168.2.16 |01:01:00:99:02:09 - 01:01:00:99:02:16 |
|vlan10_nb1-nb8|Port1-8 |192.168.1.1 ~ 192.168.1.8 |00:01:01:99:01:01 - 00:01:01:99:01:08|
|vlan20_nb1-nb8|Port9-16|192.168.2.9 ~ 192.168.2.16 |00:01:01:99:02:09 - 00:01:01:99:02:16|


### 2.4.2 LAG Neighbors

|Name|Port|IP|dest_mac|
|-|-|-|-|
|lag1_nb|lag1| 10.0.1.101 | 02:04:02:01:01:01|
|lag2_nb|lag2| 10.0.2.101 | 02:04:02:01:02:01|
|lag1_nb|lag1| 10.1.1.101 | 02:04:02:01:01:01|
|lag2_nb|lag2| 10.1.2.101 | 02:04:02:01:02:01|
23 changes: 11 additions & 12 deletions doc/sai-ptf/lag_test_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
- [Case4: test_loadbalance_on_destinstion_ip](#case4-test_loadbalance_on_destinstion_ip)
- [Case5: test_loadbalance_on_protocol](#case5-test_loadbalance_on_protocol)
- [Test Group2: Disable Egress/Ingress](#test-group2-disable-egressingress)
- [Case6: test_disable_egress](#case6-test_disable_egress)
- [Case7: test_disable_ingress](#case7-test_disable_ingress)
- [Case1: test_disable_egress](#case1-test_disable_egress)
- [Case2: test_disable_ingress](#case2-test_disable_ingress)
- [Test Group3: Remove/Add LAG member](#test-group3-removeadd-lag-member)
- [Case8: test_remove_lag_member](#case8-test_remove_lag_member)
- [Case9: test_add_lag_member](#case9-test_add_lag_member)
- [Case1: test_remove_lag_member](#case1-test_remove_lag_member)
- [Case2: test_add_lag_member](#case2-test_add_lag_member)
- [Test Group4: Indifference Ingress Port in Hash](#test-group4-indifference-ingress-port-in-hash)
- [Case10: test_ingress_port_hash_indiff](#case10-test_ingress_port_hash_indiff)
- [Test Objective](#test-objective)
- [Case1: test_ingress_port_hash_indiff](#case1-test_ingress_port_hash_indiff)
# Overriew
The purpose of this test plan is to test the LAG/PortChannel function from SAI.

Expand Down Expand Up @@ -93,8 +92,8 @@ For load balancing, expecting the ports in a lag should receive the packet equal
## Test Group2: Disable Egress/Ingress


### Case6: test_disable_egress
### Case7: test_disable_ingress
### Case1: test_disable_egress
### Case2: test_disable_ingress

### Testing Objective <!-- omit in toc -->
These cases will cover two scenarios: disable egress and ingress. We can disable ingress or egress on a lag member, then we expect traffic drop on the disabled lag member.
Expand All @@ -119,8 +118,8 @@ These cases will cover two scenarios: disable egress and ingress. We can disabl
6. Check if Packet drop on port1

## Test Group3: Remove/Add LAG member
### Case8: test_remove_lag_member
### Case9: test_add_lag_member
### Case1: test_remove_lag_member
### Case2: test_add_lag_member
### Testing Objective <!-- omit in toc -->
These cases will cover adding and removing the lag members. We can remove or add a lag member, then expect traffic to drop/appear on the lag member.

Expand All @@ -143,9 +142,9 @@ These cases will cover adding and removing the lag members. We can remove or ad


## Test Group4: Indifference Ingress Port in Hash
### Case10: test_ingress_port_hash_indiff
### Case1: test_ingress_port_hash_indiff

### Test Objective
### Test Objective <!-- omit in toc -->
This case will verify the ingress ports should not be as a Hash Factor in Lag loadbalance.
When forwarding the packet from different ingress ports, if only the ingress port changed, then the loadbalance should not happen among lag members.

Expand Down
108 changes: 54 additions & 54 deletions doc/sai-ptf/vlan_test_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@
- [Case1: test_untag_access_to_access](#case1-test_untag_access_to_access)
- [Case2: test_unmatch_drop](#case2-test_unmatch_drop)
- [Test Group2: Frame Filtering](#test-group2-frame-filtering)
- [Case3: test_untagged_frame_filtering](#case3-test_untagged_frame_filtering)
- [Case4: test_tagged_frame_filtering](#case4-test_tagged_frame_filtering)
- [Case1: test_untagged_frame_filtering](#case1-test_untagged_frame_filtering)
- [Case2: test_tagged_frame_filtering](#case2-test_tagged_frame_filtering)
- [Test Group3: VLAN flooding](#test-group3-vlan-flooding)
- [Case5: test_tagged_vlan_flooding](#case5-test_tagged_vlan_flooding)
- [Case6: test_untagged_vlan_flooding](#case6-test_untagged_vlan_flooding)
- [Case1: test_tagged_vlan_flooding](#case1-test_tagged_vlan_flooding)
- [Case2: test_untagged_vlan_flooding](#case2-test_untagged_vlan_flooding)
- [Test Group4: VLAN broadcast](#test-group4-vlan-broadcast)
- [Case7: test_vlan_broadcast](#case7-test_vlan_broadcast)
- [Case1: test_vlan_broadcast](#case1-test_vlan_broadcast)
- [Test Group5: MAC learning](#test-group5-mac-learning)
- [Case8: test_untagged_mac_learning](#case8-test_untagged_mac_learning)
- [Case9: test_tagged_mac_learning](#case9-test_tagged_mac_learning)
- [Case1: test_untagged_mac_learning](#case1-test_untagged_mac_learning)
- [Case2: test_tagged_mac_learning](#case2-test_tagged_mac_learning)
- [Test Group6: Vlan member API](#test-group6-vlan-member-api)
- [Case10:test_vlan_member_api](#case10test_vlan_member_api)
- [Case1:test_vlan_member_api](#case1test_vlan_member_api)
- [Test Group7: Add member to invalidate VLAN](#test-group7-add-member-to-invalidate-vlan)
- [Case11:test_add_vlan_member_failed](#case11test_add_vlan_member_failed)
- [Case1:test_add_vlan_member_failed](#case1test_add_vlan_member_failed)
- [Test Group8: Disable mac learning](#test-group8-disable-mac-learning)
- [Case12: test_disable_mac_learning_tagged](#case12-test_disable_mac_learning_tagged)
- [Case13: test_disable_mac_learning_untagged](#case13-test_disable_mac_learning_untagged)
- [Case1: test_disable_mac_learning_tagged](#case1-test_disable_mac_learning_tagged)
- [Case2: test_disable_mac_learning_untagged](#case2-test_disable_mac_learning_untagged)
- [Test Group9: ARP Flooding and mac learning](#test-group9-arp-flooding-and-mac-learning)
- [Case14: test_arp_request_flooding](#case14-test_arp_request_flooding)
- [Case15: test_arp_response_learning](#case15-test_arp_response_learning)
- [Case1: test_arp_request_flooding](#case1-test_arp_request_flooding)
- [Case2: test_arp_response_learning](#case2-test_arp_response_learning)
- [Test Group10: VLAN Counters/Status](#test-group10-vlan-countersstatus)
- [Case16: test_tagged_vlan_status](#case16-test_tagged_vlan_status)
- [Case17: test_untagged_vlan_status](#case17-test_untagged_vlan_status)
- [Case1: test_tagged_vlan_status](#case1-test_tagged_vlan_status)
- [Case2: test_untagged_vlan_status](#case2-test_untagged_vlan_status)
# Test Configuration

For the test configuration, please refer to the file
Expand All @@ -46,7 +46,7 @@ In this VLAN test, most of the test cases will be tested with a Tagged or Untagg
```python
tagged_packet(eth_dst='00:11:11:11:11:11',
eth_src='00:22:22:22:22:22',
vlan_vid=1000,
vlan_vid=10,
ip_dst='172.16.0.1',
ip_ttl=64)
```
Expand Down Expand Up @@ -78,7 +78,7 @@ With an untagged packet, on the access port, when ingress and egress happen, the
```
Test example:
Untagged:
pkt(Untag:DMAC=MAC2) -> Port1:Access:VLAN1000-> Port2:Access:VLAN1000 -> pkt(Untag:DMAC=MAC2)
pkt(Untag:DMAC=MAC2) -> Port1:Access:VLAN10-> Port2:Access:VLAN10 -> pkt(Untag:DMAC=MAC2)
```
### Test steps: <!-- omit in toc -->
Expand All @@ -90,80 +90,80 @@ Untagged:
- test_unmatch_drop
1. Create ``Tagged VLAN 1010`` packet with ``mac2`` as dest mac.
1. Create ``Tagged VLAN 11`` packet with ``mac2`` as dest mac.
2. Send packet on Port1.
3. Verify packet is dropped.
## Test Group2: Frame Filtering
### Case3: test_untagged_frame_filtering
### Case4: test_tagged_frame_filtering
### Case1: test_untagged_frame_filtering
### Case2: test_tagged_frame_filtering
### Testing Objective <!-- omit in toc -->
Drop packet when the destination port from MAC table search is the port which packet comes into the switch.
```
Test example(Untag):
| MAC1 |
pkt(Untag:DMAC=MAC1 or MACX) -> Port1:Access:VLAN1000 -> FDB(contains:MAC1,MACX)| | -> X
| MACX |
| MAC1 |
pkt(Untag:DMAC=MAC1 or MACX) -> Port1:Access:VLAN10 -> FDB(contains:MAC1,MACX)| | -> X
| MACX |
```
### Test steps <!-- omit in toc -->
1. Add another ``MacX`` as Port1 mac address into the MAC table
1. Create ``Untagged``/``Tagged VLAN1000`` packet, ``mac1`` as src mac, ``MacX`` as dest mac
1. Create ``Untagged``/``Tagged VLAN10`` packet, ``mac1`` as src mac, ``MacX`` as dest mac
1. Send packet on VLAN Port.
1. Verify no packet was received on any port.
## Test Group3: VLAN flooding
### Case5: test_tagged_vlan_flooding
### Case6: test_untagged_vlan_flooding
### Case1: test_tagged_vlan_flooding
### Case2: test_untagged_vlan_flooding
### Testing Objective <!-- omit in toc -->
For mac flooding in the VLAN scenario, before learning the mac address from the packet, the packet sent to the VLAN port will flood to other ports, and the egress ports will be in the same VLAN as the ingress port.
```
Flooding
| Port2|
pkt(Untag:DMAC=MAC2) -> Port1:Access:VLAN1000 -> Flooding ->| To |-> pkt(Untag)
| Port8|
| Port2|
pkt(Untag:DMAC=MAC2) -> Port1:Access:VLAN10 -> Flooding ->| To |-> pkt(Untag)
| Port8|
```
### Test Steps: <!-- omit in toc -->
1. Create ``Untagged``/``Tagged VLAN1000`` packet, with ``mac1`` as source MAC and an un-existing ``MacX`` as dest MAC
1. Create ``Untagged``/``Tagged VLAN10`` packet, with ``mac1`` as source MAC and an un-existing ``MacX`` as dest MAC
1. Send packet on Port1.
1. Verify received packet on all VLAN 1000 ports expect Port1.
1. Verify received packet on all VLAN 10 ports expect Port1.
## Test Group4: VLAN broadcast
### Case7: test_vlan_broadcast
### Case1: test_vlan_broadcast
### Testing Objective <!-- omit in toc -->
A VLAN is a logical broadcast domain that can span multiple physical LAN segments.
### Test Steps: <!-- omit in toc -->
1. Create ``Untagged``/``Tagged VLAN1000`` packet, with ``broadcast`` MAC as dest MAC
1. Create ``Untagged``/``Tagged VLAN10`` packet, with ``broadcast`` MAC as dest MAC
2. Send packet on Port1.
3. Verify received packet on all VLAN 1000 ports expect Port1.
3. Verify received packet on all VLAN 10 ports expect Port1.
## Test Group5: MAC learning
### Case8: test_untagged_mac_learning
### Case9: test_tagged_mac_learning
### Case1: test_untagged_mac_learning
### Case2: test_tagged_mac_learning
### Testing Objective <!-- omit in toc -->
For mac learning in the VLAN scenario, after learning the mac address from the packet, the packet sent to the VLAN port will only send to the port whose MAC address matches the MAC table entry.
```
unicast
pkt(Untag:DMAC=MAC1) -> Port2:Access:VLAN1000-> Port1:Access:VLAN1000 -> pkt(Untag:DMAC=MAC1)
pkt(Untag:DMAC=MAC1) -> Port2:Access:VLAN10-> Port1:Access:VLAN10 -> pkt(Untag:DMAC=MAC1)

```
### Test Steps: <!-- omit in toc -->
1. Create ``Untagged``/``Tagged VLAN1000`` packet, with an un-existing ``MacX`` as src MAC and ``mac2`` as dest MAC
1. Create ``Untagged``/``Tagged VLAN10`` packet, with an un-existing ``MacX`` as src MAC and ``mac2`` as dest MAC
1. Send packet on a VLAN source port1.
1. Verify packet received on port2.
1. Verify MAC table get a new entry for ``MacX`` on port1,
## Test Group6: Vlan member API
### Case10:test_vlan_member_api
### Case1:test_vlan_member_api
### Testing Objective <!-- omit in toc -->
Expand All @@ -176,19 +176,19 @@ Test VLAN and member APIs.
1. Verify the VLAN member and the account of the VLAN member is increased by 1.
## Test Group7: Add member to invalidate VLAN
### Case11:test_add_vlan_member_failed
### Case1:test_add_vlan_member_failed
### Testing Objective <!-- omit in toc -->
When adding a VLAN member to a non-exist VLAN, it will fail.
### Test Steps: <!-- omit in toc -->
1. Use VLAN API to add a new Member to a non-exist VLAN, ``VLAN1010``
1. Use VLAN API to add a new Member to a non-exist VLAN, ``VLAN11``
1. Verify the VLAN member added failed.
## Test Group8: Disable mac learning
### Case12: test_disable_mac_learning_tagged
### Case13: test_disable_mac_learning_untagged
### Case1: test_disable_mac_learning_tagged
### Case2: test_disable_mac_learning_untagged
### Testing Objective <!-- omit in toc -->
Test the function when disabling VLAN MAC learning.
When disabled, no new MAC will be learned in the MAC table.
Expand All @@ -197,15 +197,15 @@ When disabled, no new MAC will be learned in the MAC table.
- Do not config the MAC table
### Test steps: <!-- omit in toc -->
1. Create ``Untagged``/``Tagged VLAN1000`` packet, with ``mac1`` as src MAC and ``mac2`` as dest MAC
1. Create ``Untagged``/``Tagged VLAN10`` packet, with ``mac1`` as src MAC and ``mac2`` as dest MAC
1. Send packet from the source port1.
1. Verify packets received on all ports except the source port1.
1. Verify MAC table, no new entry added in MAC table
## Test Group9: ARP Flooding and mac learning
### Case14: test_arp_request_flooding
### Case15: test_arp_response_learning
### Case1: test_arp_request_flooding
### Case2: test_arp_response_learning
### Testing Objective <!-- omit in toc -->
In the ARP scenario, the mac learning process is:
1. Send an ARP request, with the source MAC, dest IP, and src IP, for broadcast, the DST MAC is ff:ff:ff:ff:ff:ff
Expand All @@ -218,12 +218,12 @@ Testing ARP scenario
```
Test example:
1. ARP Request
| Port2|
ARP Req pkt(Untag:DMAC=MAC2) -> Port1:Access:VLAN1000 -> Flooding ->| to |-> pkt(Untag)
| Port8|
| Port2|
ARP Req pkt(Untag:DMAC=MAC2) -> Port1:Access:VLAN10 -> Flooding ->| to |-> pkt(Untag)
| Port8|

2. ARP Response
ARP Resp pkt(Untag:DMAC=MAC1) -> Port2:Access:VLAN1000-> Port1:Access:VLAN1000 -> pkt(Untag:DMAC=MAC1)
ARP Resp pkt(Untag:DMAC=MAC1) -> Port2:Access:VLAN10-> Port1:Access:VLAN10 -> pkt(Untag:DMAC=MAC1)

```
### Test Data/Packet <!-- omit in toc -->
Expand Down Expand Up @@ -258,7 +258,7 @@ Test example:
arp_op=2, # ARP response
ip_tgt=IP1,
ip_snd=IP2,
vlan_vid=1000,
vlan_vid=10,
hw_snd=MAC2,
hw_tgt=MAC2)
```
Expand All @@ -283,15 +283,15 @@ Test example:


## Test Group10: VLAN Counters/Status
### Case16: test_tagged_vlan_status
### Case17: test_untagged_vlan_status
### Case1: test_tagged_vlan_status
### Case2: test_untagged_vlan_status
### Testing Objective <!-- omit in toc -->

For VLAN-related counters, SAI should be able to get the counter and clear them.

### Test Steps: <!-- omit in toc -->
1. Use SAI API to get the VLAN Status ``_sai_vlan_stat_t`` (defined in [saivlan.h](https://github.com/opencomputeproject/SAI/blob/master/inc/saivlan.h) )
2. Create ``Untagged``/``Tagged VLAN1000`` packet, with ``mac1`` as src MAC and ``mac2`` as dest MAC
2. Create ``Untagged``/``Tagged VLAN10`` packet, with ``mac1`` as src MAC and ``mac2`` as dest MAC
3. Send packet from the source port1
4. Verify the packet received on the target port2
5. Verify counters increased, bytes counter: OCTETS increased, other counters + 1
Expand Down

0 comments on commit 0c53ec5

Please sign in to comment.