[masic] Fix argument issue in verify_cacl, test_cacl_application#6169
Closed
wenyiz2021 wants to merge 4 commits intosonic-net:masterfrom
wenyiz2021:test_cacl_appl
Closed
[masic] Fix argument issue in verify_cacl, test_cacl_application#6169wenyiz2021 wants to merge 4 commits intosonic-net:masterfrom wenyiz2021:test_cacl_appl
wenyiz2021 wants to merge 4 commits intosonic-net:masterfrom
wenyiz2021:test_cacl_appl
Conversation
Signed-off-by: Ubuntu <wenyi@wenyi-vm-01.pdewprncsagu3n1l4b35v5n55g.cx.internal.cloudapp.net>
|
Contributor
Author
|
/easycla |
This reverts commit 5740228.
Signed-off-by: Wenyi Zhang <[email protected]>
Contributor
Author
|
/easycla |
|
This pull request introduces 1 alert when merging d396f1d into d8db030 - view on LGTM.com new alerts:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Wenyi Zhang[email protected]
Description of PR
PR Enhance test_cacl_application to support dualtor by ZhaohuiS · Pull Request #5895 · sonic-net/sonic-mgmt (github.com) introduced 2 fixture which should be intended to work for dualtor, while it added argument in verify_cacl, which is also used for test_multiasic_cacl_application, failing to add this argument in this test leads to an argument misleading at runtime, between expected_dhcp_rules_for_standby and enum_frontend_asic_index
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
Fix issue seen on multi-asic seen after above PR merged
How did you do it?
Add argument expected_dhcp_rules_for_standby in test_cacl_application_dualtor, as the fixture take fixture duthost_dualtor that for non-dualtor, there is only 1 active_tor and returns empty list.
How did you verify/test it?
Before:
30/07/2022 07:12:07 init._log_sep_line L0160 INFO | ==================== cacl/test_cacl_application.py::test_multiasic_cacl_application[3] call ====================
30/07/2022 07:12:07 init.pytest_runtest_call L0040 ERROR | Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/_pytest/python.py", line 1464, in runtest
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
File "/usr/local/lib/python2.7/dist-packages/pluggy/hooks.py", line 286, in call
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/usr/local/lib/python2.7/dist-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/usr/local/lib/python2.7/dist-packages/pluggy/manager.py", line 87, in
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 208, in _multicall
return outcome.get_result()
File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 81, in get_result
_reraise(*ex) # noqa
File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/usr/local/lib/python2.7/dist-packages/_pytest/python.py", line 174, in pytest_pyfunc_call
testfunction(**testargs)
File "/azp/agent/_work/2/s/sonic-mgmt-int/tests/cacl/test_cacl_application.py", line 838, in test_multiasic_cacl_application
verify_cacl(duthost, localhost, creds, docker_network, enum_frontend_asic_index)
File "/azp/agent/_work/2/s/sonic-mgmt-int/tests/cacl/test_cacl_application.py", line 745, in verify_cacl
expected_iptables_rules, expected_ip6tables_rules = generate_expected_rules(duthost, docker_network, asic_index, expected_dhcp_rules_for_standby)
File "/azp/agent/_work/2/s/sonic-mgmt-int/tests/cacl/test_cacl_application.py", line 416, in generate_expected_rules
iptables_rules.extend(expected_dhcp_rules_for_standby)
TypeError: 'int' object is not iterable
After:
cacl/test_cacl_application.py::test_cacl_application_nondualtor PASSED [ 7%]
cacl/test_cacl_application.py::test_cacl_application_dualtor[active_tor] SKIPPED [ 15%]
cacl/test_cacl_application.py::test_cacl_application_dualtor[standby_tor] SKIPPED [ 23%]
cacl/test_cacl_application.py::test_multiasic_cacl_application[active_tor-0] PASSED [ 30%]
cacl/test_cacl_application.py::test_multiasic_cacl_application[standby_tor-0] PASSED [ 38%]
cacl/test_cacl_application.py::test_multiasic_cacl_application[active_tor-1] PASSED [ 46%]
cacl/test_cacl_application.py::test_multiasic_cacl_application[standby_tor-1] PASSED [ 53%]
cacl/test_cacl_application.py::test_multiasic_cacl_application[active_tor-2] PASSED [ 61%]
cacl/test_cacl_application.py::test_multiasic_cacl_application[standby_tor-2] PASSED [ 69%]
cacl/test_cacl_application.py::test_multiasic_cacl_application[active_tor-3] PASSED [ 76%]
cacl/test_cacl_application.py::test_multiasic_cacl_application[standby_tor-3] PASSED [ 84%]
cacl/test_cacl_application.py::test_cacl_scale_rules_ipv4 PASSED [ 92%]
cacl/test_cacl_application.py::test_cacl_scale_rules_ipv6 PASSED [100%]
--------------------------------------------------------------------------------------------- generated xml file: /var/src/sonic-mgmt-int/tests/logs/tr.xml ----------------------------------------------------------------------------------------------
================================================================================================================ short test summary info =================================================================================================================
SKIPPED [2] cacl/test_cacl_application.py: test_cacl_application_dualtor is only supported on dualtor topology
========================================================================================================= 11 passed, 2 skipped in 895.93 seconds =========================================================================================================
Any platform specific information?
Fix for multi-asic dut
Supported testbed topology if it's a new test case?
Documentation