Skip to content
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

[Snappi] Replacing dut.shell with dut.command for clearing counters in snappi clear_counter function #16272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions tests/common/snappi_tests/common_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1117,19 +1117,19 @@ def clear_counters(duthost, port):
None
"""

duthost.shell("sudo sonic-clear counters \n")
duthost.shell("sudo sonic-clear pfccounters \n")
duthost.shell("sudo sonic-clear priority-group drop counters \n")
duthost.shell("sonic-clear counters \n")
duthost.shell("sonic-clear pfccounters \n")
duthost.command("sudo sonic-clear counters \n")
duthost.command("sudo sonic-clear pfccounters \n")
duthost.command("sudo sonic-clear priority-group drop counters \n")
duthost.command("sudo sonic-clear queue watermark all \n")
duthost.command("sudo sonic-clear priority-group drop counters \n")
duthost.command("sonic-clear counters \n")
duthost.command("sonic-clear pfccounters \n")
duthost.command("sonic-clear queuecounters \n")
duthost.command("sonic-clear queue watermark all \n")

if (duthost.is_multi_asic):
asic = duthost.get_port_asic_instance(port).get_asic_namespace()
duthost.shell("sudo ip netns exec {} sonic-clear queuecounters \n".format(asic))
duthost.shell("sudo ip netns exec {} sonic-clear dropcounters \n".format(asic))
else:
duthost.shell("sonic-clear queuecounters \n")
duthost.shell("sonic-clear dropcounters \n")
duthost.command("sudo ip netns exec {} sonic-clear dropcounters \n".format(asic))


def get_interface_stats(duthost, port):
Expand Down
Loading