Skip to content

Commit

Permalink
[Snappi] Bug fix for packet aging BRCMSAI command on broadcom-dnx pla…
Browse files Browse the repository at this point in the history
…tforms (sonic-net#11774)

* added switch case for not running bcmsai commands on td3

* enabling and disabling packet aging on broadcom-dnx platforms only

* remove unused import
  • Loading branch information
developfast authored Feb 29, 2024
1 parent 7fd9349 commit 49f76fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions tests/common/snappi_tests/common_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import re
from netaddr import IPNetwork
from tests.common.mellanox_data import is_mellanox_device as isMellanoxDevice
from tests.common.broadcom_data import is_broadcom_device as isBroadcomDevice
from ipaddress import IPv6Network, IPv6Address
from random import getrandbits

Expand Down Expand Up @@ -746,7 +745,7 @@ def disable_packet_aging(duthost, asic_value=None):
duthost.command("docker cp /tmp/packets_aging.py syncd:/")
duthost.command("docker exec syncd python /packets_aging.py disable")
duthost.command("docker exec syncd rm -rf /packets_aging.py")
elif isBroadcomDevice(duthost):
elif "platform_asic" in duthost.facts and duthost.facts["platform_asic"] == "broadcom-dnx":
try:
duthost.shell('bcmcmd -n {} "BCMSAI credit-watchdog disable"'.format(asic_value))
except Exception:
Expand All @@ -767,7 +766,7 @@ def enable_packet_aging(duthost, asic_value=None):
duthost.command("docker cp /tmp/packets_aging.py syncd:/")
duthost.command("docker exec syncd python /packets_aging.py enable")
duthost.command("docker exec syncd rm -rf /packets_aging.py")
elif isBroadcomDevice(duthost):
elif "platform_asic" in duthost.facts and duthost.facts["platform_asic"] == "broadcom-dnx":
try:
duthost.shell('bcmcmd -n {} "BCMSAI credit-watchdog enable"'.format(asic_value))
except Exception:
Expand Down
2 changes: 1 addition & 1 deletion tests/snappi_tests/ecn/files/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def run_ecn_test(api,

logger.info("Stopping PFC watchdog")
stop_pfcwd(duthost)
logger.info("Disabling packet aging")
logger.info("Disabling packet aging if necessary")
disable_packet_aging(duthost)

# Configure WRED/ECN thresholds
Expand Down

0 comments on commit 49f76fe

Please sign in to comment.