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

[test_vlan] Fix test_vlan #2090

Merged
merged 2 commits into from
Aug 14, 2020
Merged

Conversation

bingwang-ms
Copy link
Collaborator

@bingwang-ms bingwang-ms commented Aug 12, 2020

Description of PR

Summary:
Fixes # (issue)
This PR fix two issues in test_vlan.py

  1. Add a new method to capture and check packets from involved interfaces, including portchannel. If packet is captured from any port of the portchannel, the check passes.
  2. VLAN priority is ignored when matching expected packets, because the VLAN priority is determined by the port and VLAN configuration.

Type of change

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

Approach

What is the motivation for this PR?

This PR is to fix test_vlan case.

How did you do it?

Two updates:

  1. Add a new method to capture and check packets from interfaces (including portchannel);
  2. VLAN priority is ignored when matching expected packets.

How did you verify/test it?

Verify it on Arista-7260cx3 DUT.

========================================================================================= test session starts =========================================================================================
platform linux2 -- Python 2.7.12, pytest-4.6.5, py-1.8.1, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
ansible: 2.8.7
rootdir: /data/Networking-acs-sonic-mgmt/tests, inifile: pytest.ini
plugins: forked-1.1.3, xdist-1.28.0, ansible-2.2.2, repeat-0.8.0
collected 3 items                                                                                                                                                                                     

vlan/test_vlan.py::test_vlan_tc1_send_untagged PASSED                                                                                                                                           [ 33%]
vlan/test_vlan.py::test_vlan_tc2_send_tagged PASSED                                                                                                                                             [ 66%]
vlan/test_vlan.py::test_vlan_tc3_send_invalid_vid PASSED                                                                                                                                        [100%]

------------------------------------------------------------------ generated xml file: /data/Networking-acs-sonic-mgmt/tests/tr.xml -------------------------------------------------------------------
===================================================================================== 3 passed in 416.55 seconds =====================================================================================

Any platform specific information?

No.

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

N/A

Documentation

No.

tests/vlan/test_vlan.py Outdated Show resolved Hide resolved
- add a new method to capture and check packets
- add a mask to ignore vlan priority

fix vlan test
@lgtm-com
Copy link

lgtm-com bot commented Aug 13, 2020

This pull request introduces 1 alert when merging cd3f5b8 into d31cc1d - view on LGTM.com

new alerts:

  • 1 for Unused import

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.

lgtm

@bingwang-ms bingwang-ms merged commit bb06740 into sonic-net:master Aug 14, 2020
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.

3 participants