-
Notifications
You must be signed in to change notification settings - Fork 1k
Add basic MPLS testcases #3483
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
Add basic MPLS testcases #3483
Changes from 15 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
ff9cbc5
Adding mpls tests
81b3f65
Added comments
SijiJ 756fa1f
Delete route_del_routes.json
SijiJ ea00aca
Modify comment
276cabc
Merge branch 'Azure:master' into master
SijiJ 832786e
Add MPLS testplan
d802deb
Merge remote-tracking branch 'refs/remotes/origin/master'
eb64bcf
Update label_push_routes.json
SijiJ 6422fb7
Update label_pop_routes.json
SijiJ f194a66
Update label_swap_routes.json
SijiJ 2a95aa2
Update MPLS-test-plan.md
SijiJ a60bef6
Update label_pop_routes.json
SijiJ 924499e
Update label_push_routes.json
SijiJ 83fb57b
Update label_swap_routes.json
SijiJ c81f50a
Update MPLS-test-plan.md
SijiJ 44193f0
Create label_pop_routes.j2
SijiJ 91e61ac
Create label_push_routes.j2
SijiJ df0a2c8
Create label_swap_routes.j2
SijiJ 9f4a84a
Delete label_del_routes.json
SijiJ 022183c
Delete label_pop_routes.json
SijiJ 6e95baf
Delete label_push_routes.json
SijiJ 60af68a
Delete label_swap_routes.json
SijiJ a0c45a4
Create label_del_routes.j2
SijiJ 89cad03
Update test_mpls.py
SijiJ 6922d24
Update test_mpls.py
SijiJ d244442
Update test_mpls.py
SijiJ f379098
Update MPLS-test-plan.md
SijiJ df4e546
Update MPLS-test-plan.md
SijiJ bcae2fc
Update test_mpls.py
SijiJ 424eafc
Update MPLS-test-plan.md
SijiJ be0ed88
Create conftest.py
SijiJ 23a8e47
Update test_mpls.py
SijiJ 981b237
Update test_mpls.py
SijiJ a101ed0
Update test_mpls.py
SijiJ c95f546
Update test_mpls.py
SijiJ e901926
Update conftest.py
SijiJ 2b71479
Update test_mpls.py
SijiJ d6a4cf8
Update test_mpls.py
SijiJ 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,213 @@ | ||
| - [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) | ||
| * [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", | ||
| "mpls_pop": "1", | ||
| "weight": "1" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "INTF_TABLE:Ethernet10": { | ||
SijiJ marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "mpls": "enable" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "LABEL_ROUTE_TABLE:1000003": { | ||
| "nexthop": "10.0.0.21", | ||
| "ifname": "Ethernet10", | ||
| "mpls_pop": "1", | ||
| "weight": "1" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "INTF_TABLE:Ethernet25": { | ||
| "mpls": "enable" | ||
| }, | ||
| "OP": "SET" | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| label_push_routes.json | ||
|
|
||
| ``` | ||
| [ | ||
| { | ||
| "ROUTE_TABLE:192.168.0.1": { | ||
| "nexthop": "10.0.0.51", | ||
| "ifname": "Ethernet25", | ||
| "mpls_nh": "push1000001", | ||
| "weight": "1" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "INTF_TABLE:Ethernet25": { | ||
| "mpls": "enable" | ||
| }, | ||
| "OP": "SET" | ||
| } | ||
| ] | ||
| ``` | ||
| label_swap_routes.json | ||
|
|
||
| ``` | ||
| [ | ||
| { | ||
| "LABEL_ROUTE_TABLE:1000001": { | ||
| "nexthop": "10.0.0.51", | ||
| "ifname": "Ethernet25", | ||
| "mpls_nh": "swap1000002", | ||
| "mpls_pop": "1" | ||
| "weight": "1" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "INTF_TABLE:Ethernet10": { | ||
| "mpls": "enable" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "LABEL_ROUTE_TABLE:1000003": { | ||
| "nexthop": "10.0.0.21", | ||
| "ifname": "Ethernet10", | ||
| "mpls_nh": "swap1000004", | ||
| "mpls_pop": "1", | ||
| "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. | ||
|
|
||
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,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" | ||
| } | ||
| ] | ||
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,32 @@ | ||
| [ | ||
| { | ||
| "LABEL_ROUTE_TABLE:1000001": { | ||
| "nexthop": "10.0.0.51", | ||
| "ifname": "Ethernet25", | ||
| "mpls_pop": "1", | ||
| "weight": "1" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "INTF_TABLE:Ethernet10": { | ||
| "mpls": "enable" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "LABEL_ROUTE_TABLE:1000003": { | ||
| "nexthop": "10.0.0.21", | ||
| "ifname": "Ethernet10", | ||
| "mpls_pop": "1", | ||
| "weight": "1" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "INTF_TABLE:Ethernet25": { | ||
| "mpls": "enable" | ||
| }, | ||
| "OP": "SET" | ||
| } | ||
| ] |
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,17 @@ | ||
| [ | ||
| { | ||
| "ROUTE_TABLE:192.168.0.1": { | ||
| "nexthop": "10.0.0.51", | ||
| "ifname": "Ethernet25", | ||
| "mpls_nh": "push1000001", | ||
| "weight": "1" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "INTF_TABLE:Ethernet25": { | ||
| "mpls": "enable" | ||
| }, | ||
| "OP": "SET" | ||
| } | ||
| ] |
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,34 @@ | ||
| [ | ||
| { | ||
| "LABEL_ROUTE_TABLE:1000001": { | ||
| "nexthop": "10.0.0.51", | ||
| "ifname": "Ethernet25", | ||
| "mpls_nh": "swap1000002", | ||
| "mpls_pop": "1", | ||
| "weight": "1" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "INTF_TABLE:Ethernet10": { | ||
| "mpls": "enable" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "LABEL_ROUTE_TABLE:1000003": { | ||
| "nexthop": "10.0.0.21", | ||
| "ifname": "Ethernet10", | ||
| "mpls_nh": "swap1000004", | ||
| "mpls_pop": "1", | ||
| "weight": "1" | ||
| }, | ||
| "OP": "SET" | ||
| }, | ||
| { | ||
| "INTF_TABLE:Ethernet25": { | ||
| "mpls": "enable" | ||
| }, | ||
| "OP": "SET" | ||
| } | ||
| ] |
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.