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

[dvs_acl] Refactor and document dvs_acl library #1378

Merged
merged 3 commits into from
Aug 6, 2020

Conversation

daall
Copy link
Contributor

@daall daall commented Aug 5, 2020

  • Add docstrings to dvs_acl
  • Revert dvs_acl to a vanilla fixture
  • Combine redundant dvs_acl methods
  • Refactor test_acl, test_port_dpb_acl, and test_mirror_port_span to use new interface

Signed-off-by: Danny Allen [email protected]

What I did/why I did it

  1. I changed dvs_acl back into an explicit fixture that is passed in to the test methods. The reason for this is because I figured out that tools like pylint and flake8 do not handle the request.cls... update very well, which is going to be problematic very soon. In addition, this change makes it a little easier for new contributers/new dvslib adopters to see what is going on by making the inclusion of the dvs_acl module a little more explicit.

  2. I merged a few methods together in dvs_acl that were checking the same things (primarily the ACL group and port binding checks). This is for maintainability and to keep the public interface cleaner.

  3. I added a bunch of type hints and docstrings to dvs_acl to make the usage more clear.

  4. I created some fixtures in test_acl so that each individual test case can be run standalone, if the user asks for it. This should also make the PR tests more stable as it will be easier for flaky to re-run test cases in a controlled manner. Fixes [testing] vs tests in TestAcl in test_acl.py have dependency on each other #1154

  5. I deleted some dead ACL code from conftest as it wasn't being used by test_acl or test_port_dpb_acl anymore with the dvslib additions.

How I verified it
Ran the test suite locally and it passes w/ the refactor.

Details if related
Once this refactor is merged we can begin converting the rest of test_acl_* and test_mirror_* to use dvslib.

@lgtm-com
Copy link

lgtm-com bot commented Aug 5, 2020

This pull request fixes 6 alerts when merging d446794 into ea30f2f - view on LGTM.com

fixed alerts:

  • 5 for Unused import
  • 1 for 'import *' may pollute namespace

@lgtm-com
Copy link

lgtm-com bot commented Aug 5, 2020

This pull request fixes 6 alerts when merging 9956169 into ea30f2f - view on LGTM.com

fixed alerts:

  • 5 for Unused import
  • 1 for 'import *' may pollute namespace

@daall
Copy link
Contributor Author

daall commented Aug 6, 2020

retest vs please

1 similar comment
@daall
Copy link
Contributor Author

daall commented Aug 6, 2020

retest vs please

- Add docstrings to dvs_acl
- Revert dvs_acl to a vanilla fixture
- Combine redundant dvs_acl methods
- Refactor test_acl, test_port_dpb_acl, and test_mirror_port_span to use new interface

Signed-off-by: Danny Allen <[email protected]>
@lgtm-com
Copy link

lgtm-com bot commented Aug 6, 2020

This pull request fixes 6 alerts when merging 03d33e7 into 2fe99e0 - view on LGTM.com

fixed alerts:

  • 5 for Unused import
  • 1 for 'import *' may pollute namespace

@daall
Copy link
Contributor Author

daall commented Aug 6, 2020

test failures are not related to this change

@daall daall merged commit 6b1aa37 into sonic-net:master Aug 6, 2020
@daall daall deleted the acl_dvs branch August 6, 2020 23:53
@lgtm-com
Copy link

lgtm-com bot commented Aug 6, 2020

This pull request fixes 6 alerts when merging 14a9170 into 6da7036 - view on LGTM.com

fixed alerts:

  • 5 for Unused import
  • 1 for 'import *' may pollute namespace

EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…sonic-net#1378)

- What I did
Remove dhcp relay commands from sonic-utilities. dhcp-relay commands will come as a plugin with dhcp-relay docker installation.
See sonic-net/SONiC#682

- How I did it
Remove dhcp-relay commands from vlan. Make "show vlan brief" command table output extendable.

- How to verify it
Install dhcp-relay docker as app.ext. Verify that "config vlan dhcp-relay" and "show vlan brief" show dhcp data.
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.

[testing] vs tests in TestAcl in test_acl.py have dependency on each other
2 participants