Skip to content

DPB-ACL scale tests (#30) #1243

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 3 commits into from
May 4, 2020
Merged

Conversation

vasant17
Copy link
Contributor

@vasant17 vasant17 commented Apr 6, 2020

  • DPB-ACL scale tests and code-review comments addressed

  • Remove sleeps that were put earlier

Co-authored-by: Vasant [email protected]

What I did
Wrote DPB scale test cases
Why I did it
To catch any race conditions or corner cases

How I verified it
Ran VS test cases

Details if related

vapatil@server09:~/workspace/DPB/sonic-buildimage/src/sonic-swss/tests$ sudo pytest --pdb -s -v --dvsname=vs-vp test_port_dpb_acl.py
======================================================================= test session starts ========================================================================
platform linux2 -- Python 2.7.15+, pytest-3.3.0, py-1.8.0, pluggy-0.6.0 -- /usr/bin/python
cachedir: .cache
rootdir: /home/vapatil/workspace/DPB/sonic-buildimage/src/sonic-swss/tests, inifile:
collected 5 items

test_port_dpb_acl.py::TestPortDPBAcl::test_acl_table_empty_port_list remove extra link dummy
Exception AssertionError: AssertionError(u"assert 0 > 0\n +  where 0 = int('0')\n +    where '0' = <built-in method group of _sre.SRE_Match object at 0x7f3062bcde40>(1)\n +      where <built-in method group of _sre.SRE_Match object at 0x7f3062bcde40> = <_sre.SRE_Match object at 0x7f3062bcde40>.group",) in <bound method ApplDbValidator.__del__ of <conftest.ApplDbValidator object at 0x7f3062bcbf10>> ignored
PASSED                                                                                  [ 20%]
test_port_dpb_acl.py::TestPortDPBAcl::test_one_port_two_acl_tables PASSED                                                                                    [ 40%]
test_port_dpb_acl.py::TestPortDPBAcl::test_one_acl_table_many_ports PASSED                                                                                   [ 60%]
test_port_dpb_acl.py::TestPortDPBAcl::test_one_port_many_acl_tables PASSED                                                                                   [ 80%]
test_port_dpb_acl.py::TestPortDPBAcl::test_all_ports_two_acl_tables PASSED                                                                                   [100%]Exception AssertionError: AssertionError(u"assert 0 > 0\n +  where 0 = int('0')\n +    where '0' = <built-in method group of _sre.SRE_Match object at 0x7f3062caa648>(1)\n +      where <built-in method group of _sre.SRE_Match object at 0x7f3062caa648> = <_sre.SRE_Match object at 0x7f3062caa648>.group",) in <bound method ApplDbValidator.__del__ of <conftest.ApplDbValidator object at 0x7f3062c15f10>> ignored


=================================================================== 5 passed in 1080.87 seconds ====================================================================
vapatil@server09:~/workspace/DPB/sonic-buildimage/src/sonic-swss/tests$

Test cases after second commit

$ sudo pytest -s -v --dvsname=vs-vp test_acl.py test_port_dpb_acl.py
================================================================================== test session starts ==================================================================================
platform linux2 -- Python 2.7.17, pytest-3.3.0, py-1.8.0, pluggy-0.6.0 -- /usr/bin/python
cachedir: .cache
rootdir: /home/vapatil/workspace/DPB/sonic-buildimage/src/sonic-swss/tests, inifile:
collected 29 items

test_acl.py::TestAcl::test_AclTableCreation remove extra link dummy
PASSED                                                                                                                                [  3%]
test_acl.py::TestAcl::test_AclRuleL4SrcPort PASSED                                                                                                                                [  6%]
test_acl.py::TestAcl::test_AclRuleInOutPorts PASSED                                                                                                                               [ 10%]
test_acl.py::TestAcl::test_AclRuleInPortsNonExistingInterface PASSED                                                                                                              [ 13%]
test_acl.py::TestAcl::test_AclRuleOutPortsNonExistingInterface PASSED                                                                                                             [ 17%]
test_acl.py::TestAcl::test_AclTableDeletion PASSED                                                                                                                                [ 20%]
test_acl.py::TestAcl::test_V6AclTableCreation PASSED                                                                                                                              [ 24%]
test_acl.py::TestAcl::test_V6AclRuleIPv6Any PASSED                                                                                                                                [ 27%]
test_acl.py::TestAcl::test_V6AclRuleIPv6AnyDrop PASSED                                                                                                                            [ 31%]
test_acl.py::TestAcl::test_V6AclRuleIpProtocol PASSED                                                                                                                             [ 34%]
test_acl.py::TestAcl::test_V6AclRuleSrcIPv6 PASSED                                                                                                                                [ 37%]
test_acl.py::TestAcl::test_V6AclRuleDstIPv6 PASSED                                                                                                                                [ 41%]
test_acl.py::TestAcl::test_V6AclRuleL4SrcPort PASSED                                                                                                                              [ 44%]
test_acl.py::TestAcl::test_V6AclRuleL4DstPort PASSED                                                                                                                              [ 48%]
test_acl.py::TestAcl::test_V6AclRuleTCPFlags PASSED                                                                                                                               [ 51%]
test_acl.py::TestAcl::test_V6AclRuleL4SrcPortRange PASSED                                                                                                                         [ 55%]
test_acl.py::TestAcl::test_V6AclRuleL4DstPortRange PASSED                                                                                                                         [ 58%]
test_acl.py::TestAcl::test_V6AclTableDeletion PASSED                                                                                                                              [ 62%]
test_acl.py::TestAcl::test_InsertAclRuleBetweenPriorities PASSED                                                                                                                  [ 65%]
test_acl.py::TestAcl::test_RulesWithDiffMaskLengths PASSED                                                                                                                        [ 68%]
test_acl.py::TestAcl::test_AclRuleIcmp PASSED                                                                                                                                     [ 72%]
test_acl.py::TestAcl::test_AclRuleIcmpV6 PASSED                                                                                                                                   [ 75%]
test_acl.py::TestAcl::test_AclRuleRedirectToNextHop PASSED                                                                                                                        [ 79%]
test_acl.py::TestAclRuleValidation::test_AclActionValidation PASSED                                                                                                               [ 82%]
test_port_dpb_acl.py::TestPortDPBAcl::test_acl_table_empty_port_list remove extra link dummy
PASSED                                                                                                       [ 86%]
test_port_dpb_acl.py::TestPortDPBAcl::test_one_port_two_acl_tables PASSED                                                                                                         [ 89%]
test_port_dpb_acl.py::TestPortDPBAcl::test_one_acl_table_many_ports PASSED                                                                                                        [ 93%]
test_port_dpb_acl.py::TestPortDPBAcl::test_one_port_many_acl_tables PASSED                                                                                                        [ 96%]
test_port_dpb_acl.py::TestPortDPBAcl::test_many_ports_many_acl_tables PASSED                                                                                                      [100%]

============================================================================== 29 passed in 454.67 seconds ==============================================================================

Test result after third commit

vapatil@server09:~/workspace/DPB/sonic-buildimage/src/sonic-swss/tests$ sudo pytest -s -v --pdb --dvsname=vs-vp test_port_dpb_acl.py
================================================================================== test session starts ==================================================================================
platform linux2 -- Python 2.7.17, pytest-3.3.0, py-1.8.0, pluggy-0.6.0 -- /usr/bin/python
cachedir: .cache
rootdir: /home/vapatil/workspace/DPB/sonic-buildimage/src/sonic-swss/tests, inifile:
collected 5 items                                                                                                                                                                       

test_port_dpb_acl.py::TestPortDPBAcl::test_acl_table_empty_port_list remove extra link dummy
Exception AssertionError: AssertionError(u"assert 0 > 0\n +  where 0 = int('0')\n +    where '0' = <built-in method group of _sre.SRE_Match object at 0x7f520407f130>(1)\n +      where <built-in method group of _sre.SRE_Match object at 0x7f520407f130> = <_sre.SRE_Match object at 0x7f520407f130>.group",) in <bound method ApplDbValidator.__del__ of <conftest.ApplDbValidator object at 0x7f5203fd5090>> ignored
PASSED                                                                                                       [ 20%]
test_port_dpb_acl.py::TestPortDPBAcl::test_one_port_two_acl_tables PASSED                                                                                                         [ 40%]
test_port_dpb_acl.py::TestPortDPBAcl::test_one_acl_table_many_ports PASSED                                                                                                        [ 60%]
test_port_dpb_acl.py::TestPortDPBAcl::test_one_port_many_acl_tables PASSED                                                                                                        [ 80%]
test_port_dpb_acl.py::TestPortDPBAcl::test_many_ports_many_acl_tables PASSED                                                                                                      [100%]Exception AssertionError: AssertionError(u"assert 0 > 0\n +  where 0 = int('0')\n +    where '0' = <built-in method group of _sre.SRE_Match object at 0x7f52040457b0>(1)\n +      where <built-in method group of _sre.SRE_Match object at 0x7f52040457b0> = <_sre.SRE_Match object at 0x7f52040457b0>.group",) in <bound method ApplDbValidator.__del__ of <conftest.ApplDbValidator object at 0x7f5203f7fa90>> ignored


============================================================================== 5 passed in 332.76 seconds ===============================================================================
vapatil@server09:~/workspace/DPB/sonic-buildimage/src/sonic-swss/tests$

vapatil@server09:~/workspace/DPB/sonic-buildimage/src/sonic-swss/tests$ sudo pytest -s -v --pdb --dvsname=vs-vp test_acl.py
================================================================================== test session starts ==================================================================================
platform linux2 -- Python 2.7.17, pytest-3.3.0, py-1.8.0, pluggy-0.6.0 -- /usr/bin/python
cachedir: .cache
rootdir: /home/vapatil/workspace/DPB/sonic-buildimage/src/sonic-swss/tests, inifile:
collected 24 items

test_acl.py::TestAcl::test_AclTableCreation remove extra link dummy
PASSED                                                                                                                                [  4%]
test_acl.py::TestAcl::test_AclRuleL4SrcPort PASSED                                                                                                                                [  8%]
test_acl.py::TestAcl::test_AclRuleInOutPorts PASSED                                                                                                                               [ 12%]
test_acl.py::TestAcl::test_AclRuleInPortsNonExistingInterface PASSED                                                                                                              [ 16%]
test_acl.py::TestAcl::test_AclRuleOutPortsNonExistingInterface PASSED                                                                                                             [ 20%]
test_acl.py::TestAcl::test_AclTableDeletion PASSED                                                                                                                                [ 25%]
test_acl.py::TestAcl::test_V6AclTableCreation PASSED                                                                                                                              [ 29%]
test_acl.py::TestAcl::test_V6AclRuleIPv6Any PASSED                                                                                                                                [ 33%]
test_acl.py::TestAcl::test_V6AclRuleIPv6AnyDrop PASSED                                                                                                                            [ 37%]
test_acl.py::TestAcl::test_V6AclRuleIpProtocol PASSED                                                                                                                             [ 41%]
test_acl.py::TestAcl::test_V6AclRuleSrcIPv6 PASSED                                                                                                                                [ 45%]
test_acl.py::TestAcl::test_V6AclRuleDstIPv6 PASSED                                                                                                                                [ 50%]
test_acl.py::TestAcl::test_V6AclRuleL4SrcPort PASSED                                                                                                                              [ 54%]
test_acl.py::TestAcl::test_V6AclRuleL4DstPort PASSED                                                                                                                              [ 58%]
test_acl.py::TestAcl::test_V6AclRuleTCPFlags PASSED                                                                                                                               [ 62%]
test_acl.py::TestAcl::test_V6AclRuleL4SrcPortRange PASSED                                                                                                                         [ 66%]
test_acl.py::TestAcl::test_V6AclRuleL4DstPortRange PASSED                                                                                                                         [ 70%]
test_acl.py::TestAcl::test_V6AclTableDeletion PASSED                                                                                                                              [ 75%]
test_acl.py::TestAcl::test_InsertAclRuleBetweenPriorities PASSED                                                                                                                  [ 79%]
test_acl.py::TestAcl::test_RulesWithDiffMaskLengths PASSED                                                                                                                        [ 83%]
test_acl.py::TestAcl::test_AclRuleIcmp PASSED                                                                                                                                     [ 87%]
test_acl.py::TestAcl::test_AclRuleIcmpV6 PASSED                                                                                                                                   [ 91%]
test_acl.py::TestAcl::test_AclRuleRedirectToNextHop PASSED                                                                                                                        [ 95%]
test_acl.py::TestAclRuleValidation::test_AclActionValidation PASSED                                                                                                               [100%]Exception AssertionError: AssertionError(u"assert 0 > 0\n +  where 0 = int('0')\n +    where '0' = <built-in method group of _sre.SRE_Match object at 0x7efdf26ac730>(1)\n +      where <built-in method group of _sre.SRE_Match object at 0x7efdf26ac730> = <_sre.SRE_Match object at 0x7efdf26ac730>.group",) in <bound method ApplDbValidator.__del__ of <conftest.ApplDbValidator object at 0x7efdf234b250>> ignored


============================================================================== 24 passed in 140.27 seconds ==============================================================================
vapatil@server09:~/workspace/DPB/sonic-buildimage/src/sonic-swss/tests$

@lguohan
Copy link
Contributor

lguohan commented Apr 12, 2020

please use the new assert api.

vasant17 and others added 2 commits April 29, 2020 16:57
* DPB-ACL scale tests and code-review comments addressed

* Remove sleeps that were put earlier

Co-authored-by: Vasant <[email protected]>
@vasant17 vasant17 force-pushed the DPB_ACL_TEST_CASES branch from a4be55b to 6fce5d3 Compare May 1, 2020 06:30
@lgtm-com
Copy link

lgtm-com bot commented May 1, 2020

This pull request introduces 3 alerts when merging 6fce5d3 into 3829053 - view on LGTM.com

new alerts:

  • 3 for Unused import

Copy link
Contributor

@daall daall left a comment

Choose a reason for hiding this comment

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

I have a few minor suggestions but overall LGTM. :)

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2020

This pull request introduces 1 alert when merging f871bfc into 3829053 - view on LGTM.com

new alerts:

  • 1 for 'import *' may pollute namespace

@vasant17 vasant17 force-pushed the DPB_ACL_TEST_CASES branch from f871bfc to 0878d5e Compare May 4, 2020 08:44
Copy link
Contributor

@daall daall left a comment

Choose a reason for hiding this comment

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

LGTM, once we update the scope I think this is good to merge.

@daall daall merged commit e1a5e9a into sonic-net:master May 4, 2020
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…nic-net#1243)

After conversion to Python 3 using the 2to3 tool, all calls to `dict.keys()` and `dict.values()` were converted to lists. In the instances where the returned view objects from these calls are iterated over, there is no need to convert to a list, so I removed those.

Also, when iterating over the keys of a dictionary, one need not call `dict.keys()`, one can simply iterate over the dictionary as `for key in dict:`, so I cleaned those up as well.
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