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

[voq] Neighbor and host IP forwarding test cases and helpers. #3021

Merged
merged 8 commits into from May 6, 2021

Conversation

tcusto
Copy link
Contributor

@tcusto tcusto commented Feb 23, 2021

Description of PR

Summary:
Implement neighbor and forwarding tests from Distributed VoQ test plan.

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • [ x] Test case(new/improvement)

Approach

What is the motivation for this PR?

Implement automated tests to cover the neighbor lifecycle and host IP forwarding sections of the Distributed VoQ Testplan

How did you do it?

Two new test scripts were added, test_voq_nbr.py, and test_voq_ipfwd.py. Additional helpers were added to support these tests, and neighbor validation code was moved from test_voq_init.py to the helper library for code sharing.

test_voq_nbr.py includes tests for clearing the ARP and NDP tables, all at once, and one entry at a time. It also includes tests for MAC address change of the VM with and without unsolicited ARP. Port admin down test is present, and link flap will be added in a future PR. The test script also uses a shared setup fixture to bring down BGP neighbors so the ARP entries aren't immediately relearned after an action, to give the test time to do verifications. The neighbors are brought back up at the end of the script.

test_voq_ipfwd.py implements the "Host IP Forwarding" section of the VoQ test plan. It includes the table validation, link flap and the various positive and negative tests described in the test plan. Not all ports in the T2 topology are tested, there is a function to select 4 ports to use a traffic endpoints and the primary test port is a parameter to all of the test functions.

voq_helpers.py and redis.py were extended to handle neighbor deletes from redis and the Sonic ARP/route tables. Shared fixtures were relocated to conftest.py and the nbrhosts_facts fixture from test_voq_init.py was eliminated, as it was unnecessary.

The existing test_voq_init.py script was updated to use the enum_frontend_dut_hostname fixture for the tests, which eliminate the loops in the tests. The neighbor validation code for test_voq_neighbor_create was moved to voq_helpers so it could be shared with the test_voq_nbr.py script.

How did you verify/test it?

Ran against a chassis with a T2 topology.

Any platform specific information?

Supported testbed topology if it's a new test case?

T2

Documentation

@tcusto tcusto requested a review from a team as a code owner February 23, 2021 00:12
@lgtm-com
Copy link

lgtm-com bot commented Mar 10, 2021

This pull request introduces 1 alert when merging edf2ee1 into 11ed1e7 - view on LGTM.com

new alerts:

  • 1 for Unused import

@anshuv-mfst
Copy link

@yxieca, @wangxin - could you please review.
@eswaranb - please add Arista reviewers

@tcusto
Copy link
Contributor Author

tcusto commented Mar 16, 2021

retest vsimage please

@tcusto
Copy link
Contributor Author

tcusto commented Mar 17, 2021

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 3021 in repo Azure/sonic-mgmt

@yxieca
Copy link
Collaborator

yxieca commented Mar 21, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@shubav
Copy link
Contributor

shubav commented Mar 30, 2021

The pipeline checks have passed.
@yxieca, @wangxin - could you please review?
@eswaranb - could you please add Arista reviewers?

tests/voq/test_voq_ipfwd.py Show resolved Hide resolved
tests/voq/test_voq_ipfwd.py Outdated Show resolved Hide resolved
tests/voq/test_voq_ipfwd.py Outdated Show resolved Hide resolved
tests/voq/test_voq_ipfwd.py Outdated Show resolved Hide resolved
tests/voq/test_voq_ipfwd.py Show resolved Hide resolved
tests/voq/conftest.py Outdated Show resolved Hide resolved
tests/voq/test_voq_ipfwd.py Show resolved Hide resolved
@anshuv-mfst
Copy link

@saravanansv - could you please take a look as well, thanks.

@anshuv-mfst
Copy link

Hi @saravanansv - could you please review and approve, thanks.

@shubav
Copy link
Contributor

shubav commented Apr 19, 2021

Hi @saravanansv - could you please review and approve, thanks.

@saravanansv, do you have any comments? Or can we close this review and get it merged? Thanks.

@anshuv-mfst
Copy link

Hi @saravanansv - Could you please review this PR.

tests/common/helpers/redis.py Outdated Show resolved Hide resolved
tests/voq/test_voq_ipfwd.py Show resolved Hide resolved
tests/voq/voq_helpers.py Outdated Show resolved Hide resolved
@saravanansv
Copy link
Contributor

Changes look okay to me. I don't see an option to approve the PR. hence adding it as comment

@shubav
Copy link
Contributor

shubav commented May 4, 2021

@wangxin can we merge this?

@wangxin wangxin merged commit a5ddd92 into sonic-net:master May 6, 2021
bingwang-ms pushed a commit to bingwang-ms/sonic-mgmt that referenced this pull request Aug 18, 2021
We are migrating from Jenkins to azure pipeline. This PR added azure pipeline yaml files and dependent template files for nightly tests. Pipeline yaml files only added for 3 testbeds yet. The pipelines were originally added to branch azp-test of repo https://dev.azure.com/mssonic/internal/_git/sonic-mgmt-int. They have been tested on Azure DevOps.

Now we formally add these pipelines to the Networking-acs-sonic-mgmt repo. Currently the internal branch of Networking-acs-sonic-mgmt is synched to same internal branch of the sonic-mgmt-int repo. After this PR is merged, we need to update configuration of the created pipelines to formally use these files from the internal branch.

If the pipelines work fine with yaml files from internal branch, we will create more pipeline files based on current templates for rest of the nightly testbeds.

Related work items: sonic-net#3021, sonic-net#3073, sonic-net#3135, sonic-net#3153, sonic-net#3162, sonic-net#3176, sonic-net#3238, sonic-net#3241, sonic-net#3346, sonic-net#3352, sonic-net#3378, sonic-net#3389, sonic-net#3395, sonic-net#3397, sonic-net#3398, sonic-net#3407, sonic-net#3410, sonic-net#3411, sonic-net#3412, sonic-net#3413, sonic-net#3414, sonic-net#3415, sonic-net#3434, sonic-net#3437, sonic-net#3445, sonic-net#3446, sonic-net#3447, #9740131, #9821349
vmittal-msft pushed a commit to vmittal-msft/sonic-mgmt that referenced this pull request Sep 28, 2021
…net#3021)

What is the motivation for this PR?
Implement automated tests to cover the neighbor lifecycle and host IP forwarding sections of the Distributed VoQ Testplan

How did you do it?
Two new test scripts were added, test_voq_nbr.py, and test_voq_ipfwd.py. Additional helpers were added to support these tests, and neighbor validation code was moved from test_voq_init.py to the helper library for code sharing.

test_voq_nbr.py includes tests for clearing the ARP and NDP tables, all at once, and one entry at a time. It also includes tests for MAC address change of the VM with and without unsolicited ARP. Port admin down test is present, and link flap will be added in a future PR. The test script also uses a shared setup fixture to bring down BGP neighbors so the ARP entries aren't immediately relearned after an action, to give the test time to do verifications. The neighbors are brought back up at the end of the script.

test_voq_ipfwd.py implements the "Host IP Forwarding" section of the VoQ test plan. It includes the table validation, link flap and the various positive and negative tests described in the test plan. Not all ports in the T2 topology are tested, there is a function to select 4 ports to use a traffic endpoints and the primary test port is a parameter to all of the test functions.

voq_helpers.py and redis.py were extended to handle neighbor deletes from redis and the Sonic ARP/route tables. Shared fixtures were relocated to conftest.py and the nbrhosts_facts fixture from test_voq_init.py was eliminated, as it was unnecessary.

The existing test_voq_init.py script was updated to use the enum_frontend_dut_hostname fixture for the tests, which eliminate the loops in the tests. The neighbor validation code for test_voq_neighbor_create was moved to voq_helpers so it could be shared with the test_voq_nbr.py script.

How did you verify/test it?
Ran against a chassis with a T2 topology.

Any platform specific information?

Supported testbed topology if it's a new test case?
T2

Co-authored-by: Tom Custodio <thomas.custodio@nokia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants