Enhance test_cacl_application to support dualtor#5895
Enhance test_cacl_application to support dualtor#5895StormLiangMS merged 3 commits intosonic-net:masterfrom
Conversation
Signed-off-by: Zhaohui Sun <[email protected]>
|
This pull request introduces 2 alerts when merging 3003024 into cde9e34 - view on LGTM.com new alerts:
|
tests/cacl/test_cacl_application.py
Outdated
| def add_dhcp_rule_on_dualtor(tbinfo, duthosts, rand_one_dut_hostname, upper_tor_host, lower_tor_host, | ||
| toggle_all_simulator_ports_to_upper_tor): | ||
| global expect_dhcp_rules | ||
| # There are some hardcoded cacl rule for dualtot testbed, which should be ignored |
tests/cacl/test_cacl_application.py
Outdated
| from tests.common.config_reload import config_reload | ||
| from tests.common.utilities import wait_until | ||
|
|
||
| from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_upper_tor |
There was a problem hiding this comment.
It would add some extra cacl in standby tor for standby port, if that is the case, should we add one more test case to cover this other than randomly pick up a ToR to run the test?
There was a problem hiding this comment.
It would add some extra cacl in standby tor for standby port, if that is the case, should we add one more test case to cover this other than randomly pick up a ToR to run the test?
@StormLiangMS I agree with you, add a new test case test_cacl_application_dualtor in my latest commit. Please review, thanks.
Signed-off-by: Zhaohui Sun <[email protected]>
|
This pull request introduces 3 alerts when merging 9e05681 into 5c9cfaf - view on LGTM.com new alerts:
|
Signed-off-by: Zhaohui Sun <[email protected]>
|
This pull request introduces 2 alerts when merging 2a8e46f into 5c9cfaf - view on LGTM.com new alerts:
|
What is the motivation for this PR? test_cacl_application failed on dualtor, if it randomly selects standby tor to run test case, it will failed with this kind of error Failed: Unexpected iptables rules: set([u'-A DHCP -m mark --mark 0x67024 -j DROP', u'-A DHCP -m mark --mark 0x67012 -j DROP', u'-A DHCP -m mark --mark 0x67003 -j DROP', u'-A DHCP -m mark --mark 0x67002 -j DROP', u'-A DHCP -m mark --mark 0x67022 -j DROP', u'-A DHCP -m mark --mark 0x67020 -j DROP', u'-A DHCP -m mark --mark 0x67018 -j DROP', u'-A DHCP -m mark --mark 0x67014 -j DROP', u'-A DHCP -m mark --mark 0x67017 -j DROP', u'-A DHCP -m mark --mark 0x67006 -j DROP', u'-A DHCP -m mark --mark 0x67016 -j DROP', u'-A DHCP -m mark --mark 0x67019 -j DROP', u'-A DHCP -m mark --mark 0x67021 -j DROP', u'-A DHCP -m mark --mark 0x67008 -j DROP', u'-A DHCP -m mark --mark 0x67001 -j DROP', u'-A DHCP -m mark --mark 0x67010 -j DROP', u'-A DHCP -m mark --mark 0x67013 -j DROP', u'-A DHCP -m mark --mark 0x67011 -j DROP', u'-A DHCP -m mark --mark 0x67009 -j DROP', u'-A DHCP -m mark --mark 0x67007 -j DROP', u'-A DHCP -m mark --mark 0x67004 -j DROP', u'-A DHCP -m mark --mark 0x67015 -j DROP', u'-A DHCP -m mark --mark 0x67023 -j DR How did you do it? The failed reason is on standby tor, it will add one rule DHCP mark rule for each standby interface. Changes in this PR: Add a new fixture duthost_dualtor to return duthost for dualtor test case test_cacl_application_dualtor, add another new fixture expected_dhcp_rules_for_standby to generate expected dhcp mark rules for standby tor. Move pytest.skip to tests_mark_conditions.yaml Add from tests.common.dualtor.dual_tor_common import * , otherwise it will throw error of fixture 'cable_type' not found. How did you verify/test it? Run cacl/test_cacl_application.py cacl/test_cacl_application.py::test_cacl_application_nondualtor SKIPPED [ 16%] cacl/test_cacl_application.py::test_cacl_application_dualtor[active_tor] PASSED [ 33%] cacl/test_cacl_application.py::test_cacl_application_dualtor[standby_tor] PASSED [ 50%] cacl/test_cacl_application.py::test_multiasic_cacl_application[None] SKIPPED [ 66%] cacl/test_cacl_application.py::test_cacl_scale_rules_ipv4 PASSED [ 83%] cacl/test_cacl_application.py::test_cacl_scale_rules_ipv6 PASSED [100%] Any platform specific information? Supported testbed topology if it's a new test case?
Signed-off-by: Zhaohui Sun [email protected]
Description of PR
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
test_cacl_applicationfailed on dualtor, if it randomly selects standby tor to run test case, it will failed with this kind of errorFailed: Unexpected iptables rules: set([u'-A DHCP -m mark --mark 0x67024 -j DROP', u'-A DHCP -m mark --mark 0x67012 -j DROP', u'-A DHCP -m mark --mark 0x67003 -j DROP', u'-A DHCP -m mark --mark 0x67002 -j DROP', u'-A DHCP -m mark --mark 0x67022 -j DROP', u'-A DHCP -m mark --mark 0x67020 -j DROP', u'-A DHCP -m mark --mark 0x67018 -j DROP', u'-A DHCP -m mark --mark 0x67014 -j DROP', u'-A DHCP -m mark --mark 0x67017 -j DROP', u'-A DHCP -m mark --mark 0x67006 -j DROP', u'-A DHCP -m mark --mark 0x67016 -j DROP', u'-A DHCP -m mark --mark 0x67019 -j DROP', u'-A DHCP -m mark --mark 0x67021 -j DROP', u'-A DHCP -m mark --mark 0x67008 -j DROP', u'-A DHCP -m mark --mark 0x67001 -j DROP', u'-A DHCP -m mark --mark 0x67010 -j DROP', u'-A DHCP -m mark --mark 0x67013 -j DROP', u'-A DHCP -m mark --mark 0x67011 -j DROP', u'-A DHCP -m mark --mark 0x67009 -j DROP', u'-A DHCP -m mark --mark 0x67007 -j DROP', u'-A DHCP -m mark --mark 0x67004 -j DROP', u'-A DHCP -m mark --mark 0x67015 -j DROP', u'-A DHCP -m mark --mark 0x67023 -j DRHow did you do it?
The failed reason is on standby tor, it will add one rule DHCP mark rule for each standby interface.
Changes in this PR:
duthost_dualtorto return duthost for dualtor test casetest_cacl_application_dualtor, add another new fixtureexpected_dhcp_rules_for_standbyto generate expected dhcp mark rules for standby tor.tests_mark_conditions.yamlfrom tests.common.dualtor.dual_tor_common import *, otherwise it will throw error of fixture 'cable_type' not found.How did you verify/test it?
Run
cacl/test_cacl_application.pyAny platform specific information?
Supported testbed topology if it's a new test case?
Documentation