Skip to content

Commit

Permalink
Fix Unexpected DHCP iptables rules for test_cacl_application_dualtor …
Browse files Browse the repository at this point in the history
…case (#11878)

Description of PR
Summary:
Fixes # (issue)
On latest master image, test_cacl_application_dualtor case could fail due to the following reason:
Failed: Missing expected iptables rules: {'-A DHCP -m mark --mark 0x67005 -j DROP'}

This is caused by the oscillation logic: sonic-net/sonic-linkmgrd#221

As there is no icmp_responder running, the mux will start flap, if it flaps betrween expected_dhcp_rules_for_standby fixture and
the real iptables check, there could be some unexpected dhcp iptables which will cause case failure.

What is the motivation for this PR?
Fix Unexpected DHCP iptables rules for test_cacl_application_dualtor

How did you do it?
test_cacl_application_dualtor is used to verify dhcp iptables on dualtor, not oscillation.
Before dualtor case, set mux mode to manual
sudo config mux mode manual all
in test teardown, run to set to auto back.
sudo config mux mode auto all

How did you verify/test it?
Run cacl/test_cacl_application.py::test_cacl_application_dualtor on dualtor testbed against master image.

Any platform specific information?
  • Loading branch information
ZhaohuiS authored and mssonicbld committed May 6, 2024
1 parent 8366848 commit 4cb1ba6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/cacl/test_cacl_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def duthost_dualtor(request, upper_tor_host, lower_tor_host): # noqa F811
else:
logger.info("Select upper tor...")
dut = upper_tor_host
return dut
dut.shell("sudo config mux mode manual all")
yield dut
dut.shell("sudo config mux mode auto all")


@pytest.fixture
Expand Down

0 comments on commit 4cb1ba6

Please sign in to comment.