Skip to content
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

Add basic MPLS testcases #3483

Merged
merged 38 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ff9cbc5
Adding mpls tests
May 14, 2021
81b3f65
Added comments
SijiJ May 14, 2021
756fa1f
Delete route_del_routes.json
SijiJ May 14, 2021
ea00aca
Modify comment
May 14, 2021
276cabc
Merge branch 'Azure:master' into master
SijiJ May 14, 2021
832786e
Add MPLS testplan
May 17, 2021
d802deb
Merge remote-tracking branch 'refs/remotes/origin/master'
May 17, 2021
eb64bcf
Update label_push_routes.json
SijiJ Jun 16, 2021
6422fb7
Update label_pop_routes.json
SijiJ Jun 16, 2021
f194a66
Update label_swap_routes.json
SijiJ Jun 16, 2021
2a95aa2
Update MPLS-test-plan.md
SijiJ Jun 16, 2021
a60bef6
Update label_pop_routes.json
SijiJ Jun 29, 2021
924499e
Update label_push_routes.json
SijiJ Jun 29, 2021
83fb57b
Update label_swap_routes.json
SijiJ Jun 29, 2021
c81f50a
Update MPLS-test-plan.md
SijiJ Jun 29, 2021
44193f0
Create label_pop_routes.j2
SijiJ Jan 20, 2022
91e61ac
Create label_push_routes.j2
SijiJ Jan 20, 2022
df0a2c8
Create label_swap_routes.j2
SijiJ Jan 20, 2022
9f4a84a
Delete label_del_routes.json
SijiJ Jan 20, 2022
022183c
Delete label_pop_routes.json
SijiJ Jan 20, 2022
6e95baf
Delete label_push_routes.json
SijiJ Jan 20, 2022
60af68a
Delete label_swap_routes.json
SijiJ Jan 20, 2022
a0c45a4
Create label_del_routes.j2
SijiJ Jan 20, 2022
89cad03
Update test_mpls.py
SijiJ Jan 20, 2022
6922d24
Update test_mpls.py
SijiJ Jan 20, 2022
d244442
Update test_mpls.py
SijiJ Jan 20, 2022
f379098
Update MPLS-test-plan.md
SijiJ Jan 25, 2022
df4e546
Update MPLS-test-plan.md
SijiJ Jan 25, 2022
bcae2fc
Update test_mpls.py
SijiJ Jan 25, 2022
424eafc
Update MPLS-test-plan.md
SijiJ Feb 9, 2022
be0ed88
Create conftest.py
SijiJ Mar 16, 2022
23a8e47
Update test_mpls.py
SijiJ Mar 16, 2022
981b237
Update test_mpls.py
SijiJ Mar 16, 2022
a101ed0
Update test_mpls.py
SijiJ Mar 16, 2022
c95f546
Update test_mpls.py
SijiJ Mar 17, 2022
e901926
Update conftest.py
SijiJ Mar 17, 2022
2b71479
Update test_mpls.py
SijiJ Apr 27, 2022
d6a4cf8
Update test_mpls.py
SijiJ May 4, 2022
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
206 changes: 206 additions & 0 deletions docs/testplan/MPLS-test-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
- [Overview](#overview)
* [Scope](#scope)
* [Testbed](#testbed)
- [Setup configuration](#setup-configuration)
+ [Setup of DUT switch](#setup-of-dut-switch)
- [Test cases](#test-cases)
* [Test case \#1 - POP Label](#test-case-1---pop-label)
+ [Test objective](#test-objective)
+ [Test steps](#test-steps)
* [Test case \#2 - SWAP Label for single label](#test-case-2---swap-label-for-single-label)
+ [Test objective](#test-objective-1)
+ [Test steps](#test-steps-1)
* [Test case \#3 - PUSH Label](#test-case-3---push-label)
+ [Test objective](#test-objective-2)
+ [Test steps](#test-steps-2)
SijiJ marked this conversation as resolved.
Show resolved Hide resolved
* [Test case \#4 - SWAP Label for multiple label stack](#test-case-4---swap-label-for-multiple-label-stack)
+ [Test objective](#test-objective-3)
+ [Test steps](#test-steps-3)

## Overview
This is Test Plan to test MPLS feature on SONiC. The test enables MPLS on interfaces, configures static LSPs and assumes all basic configurations including BGP routes are already preconfigured.

### Scope
The test is targeting a running SONiC system with basic functioning configuration.
Purpose of the test is to verify MPLS on a SONiC system bringing up the ingress, transit or egress static LSP and forwarding the traffic correctly.

### Testbed
T1

## Setup configuration
MPLS configuration will be set on DUT dynamically.

#### Setup of DUT switch
During testrun, Ansible will copy JSON file containing configuration for MPLS to DUT and push to SONiC APPL DB via swssconfig.

JSON Sample:

label_pop_routes.json

```
[
{
"LABEL_ROUTE_TABLE:1000001": {
SijiJ marked this conversation as resolved.
Show resolved Hide resolved
"nexthop": "10.0.0.51",
"ifname": "Ethernet25",
"weight": "1"
},
"OP": "SET"
},
{
"INTF_TABLE:Ethernet10": {
SijiJ marked this conversation as resolved.
Show resolved Hide resolved
"mpls": "enable"
},
"OP": "SET"
},
{
"LABEL_ROUTE_TABLE:1000003": {
"nexthop": "10.0.0.21",
"ifname": "Ethernet10",
"weight": "1"
},
"OP": "SET"
},
{
"INTF_TABLE:Ethernet25": {
"mpls": "enable"
},
"OP": "SET"
}
]
```

label_push_routes.json

```
[
{
"ROUTE_TABLE:192.168.0.1": {
"nexthop": "1000001+10.0.0.51",
"ifname": "Ethernet25",
"weight": "1"
},
"OP": "SET"
},
{
"INTF_TABLE:Ethernet25": {
"mpls": "enable"
},
"OP": "SET"
}
]
```
label_swap_routes.json

```
[
{
"LABEL_ROUTE_TABLE:1000001": {
"nexthop": "1000002+10.0.0.51",
"ifname": "Ethernet25",
"weight": "1"
},
"OP": "SET"
},
{
"INTF_TABLE:Ethernet10": {
"mpls": "enable"
},
"OP": "SET"
},
{
"LABEL_ROUTE_TABLE:1000003": {
"nexthop": "1000004+10.0.0.21",
"ifname": "Ethernet10",
"weight": "1"
},
"OP": "SET"
},
{
"INTF_TABLE:Ethernet25": {
"mpls": "enable"
},
"OP": "SET"
}
]
```
label_del_routes.json

```
[
{
"LABEL_ROUTE_TABLE:1000001": {
},
"OP": "DEL"
},
{
"INTF_TABLE:Ethernet10": {
},
"OP": "DEL"
},
{
"LABEL_ROUTE_TABLE:1000003": {
},
"OP": "DEL"
},
{
"INTF_TABLE:Ethernet25": {
},
"OP": "DEL"
},
{
"ROUTE_TABLE:192.168.0.1": {
},
"OP": "DEL"
}
]
```
## Test cases

Each testcase configures static LSP, sends traffic, captures on receving port and verifies appropriate LABEL action is applied on packet.

### Test case \#1 - POP Label

#### Test objective

Verify that the MPLS label is removed on the received packet.

#### Test steps
- Enable MPLS on interfaces and configure pop label.
- Send MPLS packet.
- Capture the packet and verify that it is IP packet with MPLS removed.

### Test case \#2 - SWAP Label for single label

#### Test objective

Verify that the MPLS label is swapped on the received packet.

#### Test steps
- Enable MPLS on interfaces and configure swap label for MPLS packet.
- Send MPLS packet.
- Capture the packet and verify that it is MPLS packet with label swapped as per configuration.

### Test case \#3 - PUSH Label

#### Test objective

Verify that the MPLS label is pushed on the received packet.

#### Test steps
- Enable MPLS on interfaces and configure push label for MPLS packet.
- Send IP packet.
- Capture the packet and verify that it is MPLS packet with label added as per configuration.


### Test case \#4 - SWAP Label for multiple label stack

#### Test objective

Verify that the MPLS top label is swapped on the received packet.

#### Test steps
- Enable MPLS on interfaces and configure swap label for MPLS packet.
- Send MPLS packet.
- Capture the packet and verify that it is MPLS packet with label swapped as per configuration for the top label.

27 changes: 27 additions & 0 deletions tests/mpls/configs/label_del_routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
SijiJ marked this conversation as resolved.
Show resolved Hide resolved
{
"LABEL_ROUTE_TABLE:1000001": {
},
"OP": "DEL"
},
{
"INTF_TABLE:Ethernet10": {
},
"OP": "DEL"
},
{
"LABEL_ROUTE_TABLE:1000003": {
},
"OP": "DEL"
},
{
"INTF_TABLE:Ethernet25": {
},
"OP": "DEL"
},
{
"ROUTE_TABLE:192.168.0.1": {
},
"OP": "DEL"
}
]
30 changes: 30 additions & 0 deletions tests/mpls/configs/label_pop_routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"LABEL_ROUTE_TABLE:1000001": {
"nexthop": "10.0.0.51",
"ifname": "Ethernet25",
"weight": "1"
},
"OP": "SET"
},
{
"INTF_TABLE:Ethernet10": {
"mpls": "enable"
},
"OP": "SET"
},
{
"LABEL_ROUTE_TABLE:1000003": {
"nexthop": "10.0.0.21",
"ifname": "Ethernet10",
"weight": "1"
},
"OP": "SET"
},
{
"INTF_TABLE:Ethernet25": {
"mpls": "enable"
},
"OP": "SET"
}
]
16 changes: 16 additions & 0 deletions tests/mpls/configs/label_push_routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"ROUTE_TABLE:192.168.0.1": {
"nexthop": "1000001+10.0.0.51",
"ifname": "Ethernet25",
"weight": "1"
},
"OP": "SET"
},
{
"INTF_TABLE:Ethernet25": {
"mpls": "enable"
},
"OP": "SET"
}
]
30 changes: 30 additions & 0 deletions tests/mpls/configs/label_swap_routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"LABEL_ROUTE_TABLE:1000001": {
"nexthop": "1000002+10.0.0.51",
"ifname": "Ethernet25",
"weight": "1"
},
"OP": "SET"
},
{
"INTF_TABLE:Ethernet10": {
"mpls": "enable"
},
"OP": "SET"
},
{
"LABEL_ROUTE_TABLE:1000003": {
"nexthop": "1000004+10.0.0.21",
"ifname": "Ethernet10",
"weight": "1"
},
"OP": "SET"
},
{
"INTF_TABLE:Ethernet25": {
"mpls": "enable"
},
"OP": "SET"
}
]
Loading