Skip to content

VxLAN Automation: Adding all remaining testcases, and the required modifications.#5059

Merged
prsunny merged 15 commits intosonic-net:masterfrom
rraghav-cisco:rraghav-vxlan2
May 3, 2022
Merged

VxLAN Automation: Adding all remaining testcases, and the required modifications.#5059
prsunny merged 15 commits intosonic-net:masterfrom
rraghav-cisco:rraghav-vxlan2

Conversation

@rraghav-cisco
Copy link
Contributor

@rraghav-cisco rraghav-cisco commented Feb 2, 2022

This is part 2 of the Vxlan Test case Automation.
Adding the rest of test cases from https://github.com/Azure/SONiC/blob/8ca1ac93c8912fda7b09de9bfd51498e5038c292/doc/vxlan/Overlay%20ECMP%20with%20BFD.md#test-cases

I have combined 13th and 14th cases into a single case in this script.
The commit on mar 28th also added a new test, a variant of TC9.

@rraghav-cisco rraghav-cisco requested a review from a team as a code owner February 2, 2022 04:54
@rraghav-cisco rraghav-cisco marked this pull request as draft February 2, 2022 04:54
@rraghav-cisco rraghav-cisco marked this pull request as ready for review February 2, 2022 05:13
@prsunny
Copy link
Contributor

prsunny commented Feb 11, 2022

@dgsudharsan , @sumukhatv , could you folks please review?

@dgsudharsan
Copy link
Contributor

@ihorchekh @roysr-nv Can you please review the tests?

@sachinv-msft sachinv-msft requested a review from prsunny February 16, 2022 04:32
@sachinv-msft
Copy link

@dgsudharsan @ihorchekh @roysr-nv any updates on this? please review this PR at your earliest conv

prsunny
prsunny previously approved these changes Feb 28, 2022
Copy link
Contributor

@roy-sror roy-sror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Can you please provide the runtime of this test suite, how much time would it take to run the entire suite?

Can you please use allure steps, rather than comments, it would make the allure report much more readable.

Copy link

@ihorchekh ihorchekh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some suggestions from my side.

@lgtm-com
Copy link

lgtm-com bot commented Mar 15, 2022

This pull request fixes 1 alert when merging 2c47f9d into 10debf5 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Mar 15, 2022

This pull request fixes 1 alert when merging 5528f35 into 10debf5 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@rraghav-cisco
Copy link
Contributor Author

rraghav-cisco commented Mar 15, 2022

@roysr-nv :
Thanks for your comments.

The latest test run took 6100 seconds, close to 2 hours. I have seen it varying from close to 1 hour to 2 hours.
I plan to convert the comment lines in all testcases to "Logger.info()" calls. Pls let me know that is what you are asking for.

@prsunny
Copy link
Contributor

prsunny commented Mar 16, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny prsunny requested a review from kevinskwang March 17, 2022 01:42
@sachinv-msft
Copy link

@kevinwangsk @rraghav-cisco where are we with this PR?

@kevinskwang
Copy link
Contributor

I tried on 8102, there are four test cases failed, other 52 are passed.
FAILED vxlan/test_vxlan_ecmp.py::Test_VxLAN_NHG_Modify::test_vxlan_remove_ecmp_route2[v4_in_v4] - Exception
FAILED vxlan/test_vxlan_ecmp.py::Test_VxLAN_NHG_Modify::test_vxlan_remove_ecmp_route2[v4_in_v6] - Exception
FAILED vxlan/test_vxlan_ecmp.py::Test_VxLAN_NHG_Modify::test_vxlan_remove_ecmp_route2[v6_in_v4] - Exception
FAILED vxlan/test_vxlan_ecmp.py::Test_VxLAN_NHG_Modify::test_vxlan_remove_ecmp_route2[v6_in_v6] - Exception

@ihorchekh
Copy link

ihorchekh commented Mar 25, 2022

@kevinskwang this PR by @dgsudharsan should fix this

@kevinskwang
Copy link
Contributor

Those cases looks good to me~ Just one question, why expect the overlay DMAC still to be the dut_mac after encap? should it be the dest VM's MAC in the vnet?

@rraghav-cisco
Copy link
Contributor Author

Those cases looks good to me~ Just one question, why expect the overlay DMAC still to be the dut_mac after encap? should it be the dest VM's MAC in the vnet?
Hi @kevinskwang : I agree with you, it is actually ignored in the test. So it is ok.

@lgtm-com
Copy link

lgtm-com bot commented Apr 23, 2022

This pull request fixes 1 alert when merging 9432578 into 35f25e1 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

Turned on the ECN testing, which was turned off till now. Needed a minor modification to the ECN calculation.
@lgtm-com
Copy link

lgtm-com bot commented Apr 23, 2022

This pull request fixes 1 alert when merging 9fb0a5c into 35f25e1 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@rraghav-cisco
Copy link
Contributor Author

@ihorchekh @dgsudharsan @prsunny : Can we merge this PR pls?

@prsunny
Copy link
Contributor

prsunny commented Apr 26, 2022

/azp run

@sonic-net sonic-net deleted a comment from azure-pipelines bot Apr 26, 2022
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sonic-net sonic-net deleted a comment from rraghav-cisco Apr 26, 2022
@sonic-net sonic-net deleted a comment from azure-pipelines bot Apr 26, 2022
@sonic-net sonic-net deleted a comment from azure-pipelines bot Apr 26, 2022
@prsunny
Copy link
Contributor

prsunny commented Apr 27, 2022

@ihorchekh @dgsudharsan, please sign-off

@prsunny
Copy link
Contributor

prsunny commented Apr 27, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines +1152 to +1153
self.setup['duthost'].shell("sudo config interface shutdown {}".format(intf))

Copy link

@ihorchekh ihorchekh Apr 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case sometimes fails here. I did debug and found that we need some delay after bringing interfaces down and sending packets. I believe 10-sec sleep will be enough.
I tried to use it here wait_until logic with passing all_intfs list, like wait_until(60, 30, 0, bgp_established, self.setup['duthost'], all_intfs) and I found another issue in bgp_established function, see below

pytest_assert(wait_until(300, 30, 0, bgp_established, self.setup['duthost']), "BGP neighbors didn't come up after all interfaces have been brought up.")

logger.info("Verify the traffic is flowing through, again.")
self.dump_self_info_and_run_ptf("tc12", encap_type, True, packet_count=1000)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.dump_self_info_and_run_ptf("tc12", encap_type, True, packet_count=1000)
self.dump_self_info_and_run_ptf("tc14", encap_type, True, packet_count=1000)

pytest_assert(wait_until(300, 30, 0, bgp_established, self.setup['duthost']), "BGP neighbors didn't come up after all interfaces have been brought up.")
logger.info("Verify traffic flows after recovery.")
self.setup[encap_type]['t2_ports'] = all_t2_ports
self.dump_self_info_and_run_ptf("tc12", encap_type, True, packet_count=1000)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.dump_self_info_and_run_ptf("tc12", encap_type, True, packet_count=1000)
self.dump_self_info_and_run_ptf("tc13", encap_type, True, packet_count=1000)

logger.info("Bring down the T2 interfaces.")
for intf in all_intfs:
self.setup['duthost'].shell("sudo config interface shutdown {}".format(intf))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
time.sleep(10)

or wait_until with passing all_intfs as ignore_list, but only if the issue mentioned above in bgp_established will be fixed.

Suggested change
pytest_assert(wait_until(60, 30, 0, bgp_established, self.setup['duthost'], all_intfs), "BGP neighbors didn't come down after all interfaces have been brought down.")

@ihorchekh
Copy link

@prsunny I believe I'll approve after my comments above will be resolved

@lgtm-com
Copy link

lgtm-com bot commented Apr 30, 2022

This pull request fixes 1 alert when merging f02fa5d into cb01d8b - view on LGTM.com

fixed alerts:

  • 1 for Unused import

1. Added more stringent checks for bgp_established() function. Now it verifies the down neighbors as well as the established neighbors.
2. Fixed minor typos in TC names, comments and logs.
3. Called the bgp_established() after bringing down the interfaces in tc12. (as per review comments).
@lgtm-com
Copy link

lgtm-com bot commented May 1, 2022

This pull request fixes 1 alert when merging 411bd24 into cb01d8b - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@prsunny
Copy link
Contributor

prsunny commented May 3, 2022

@prsunny I believe I'll approve after my comments above will be resolved

@ihorchekh , Please review the latest change

@ihorchekh
Copy link

@prsunny @rraghav-cisco I've run the updated test and I've got a 100% pass rate, 60/60.
So, I approve this PR.

Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rraghav-cisco , @ihorchekh, @roysr-nv for the great contributions on implementation and review

@prsunny prsunny merged commit e279fda into sonic-net:master May 3, 2022
wangxin pushed a commit that referenced this pull request May 5, 2022
…difications. (#5059)

* Implement part 2 of the Vxlan Overlay ECMP Test cases.
@rraghav-cisco rraghav-cisco deleted the rraghav-vxlan2 branch May 9, 2022 22:50
# Every next-hop should have received within 1% of the packets that we sent per nexthop(which is self.packet_count).
# This check is valid only if there are large enough number of packets(300). Any lower number will need higher tolerance(more than 2%).
if self.packet_count > MINIMUM_PACKETS_FOR_ECMP_VALIDATION:
tolerance = 0.01
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rraghav-cisco please clarify what this 1% value is based on. Unfortunately I was not able to find it in feature requirement docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants