-
Notifications
You must be signed in to change notification settings - Fork 741
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
Set mux mode to manual to disable port toggle in cacl scripts on dualtor testbed #12883
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,18 @@ def get_iptable_rules(duthost): | |
return rules_chain | ||
|
||
|
||
@pytest.fixture(scope="module", autouse=True) | ||
def disable_port_toggle(duthosts, tbinfo): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it's same piece of code, will it be worth to move it to dualtor common or dualtor utils, and call the fixture in tests? It's up to you, not mandatory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zjswhhh This new fixture is module fixture, which only works within script. If I move it to dualtor utils, it can't be used in specific script as module level and autouse. |
||
# set mux mode to manual on both TORs to avoid port state change during test | ||
if "dualtor" in tbinfo['topo']['name']: | ||
for dut in duthosts: | ||
dut.shell("sudo config mux mode manual all") | ||
yield | ||
if "dualtor" in tbinfo['topo']['name']: | ||
for dut in duthosts: | ||
dut.shell("sudo config mux mode auto all") | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def setup_env(duthosts, rand_one_dut_hostname): | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this check will allow if the testbed is a active-active dualtor:
dualtor-aa
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an alternative is using fixture
active_standby_ports
and check if the returned list is empty.sonic-mgmt/tests/common/dualtor/dual_tor_common.py
Line 85 in 9903dfa