Skip to content
Merged
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
17 changes: 9 additions & 8 deletions tests/telemetry/events/swss_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
logger = logging.getLogger(__name__)
tag = "sonic-events-swss"

IF_STATE_TEST_PORT = "Ethernet0"
PFC_STORM_TEST_PORT = "Ethernet4"
PFC_STORM_TEST_QUEUE = "4"
PFC_STORM_DETECTION_TIME = 100
Expand All @@ -31,15 +30,17 @@ def test_event(duthost, gnxi_path, ptfhost, data_dir, validate_yang):


def shutdown_interface(duthost):
logger.info("Shutting down an interface")
ret = duthost.shell("config interface startup {}".format(IF_STATE_TEST_PORT))
assert ret["rc"] == 0, "Failing to startup interface {}".format(IF_STATE_TEST_PORT)
logger.info("Shutting down interface")
interfaces = duthost.get_interfaces_status()
if_state_test_port = next((interface for interface, status in interfaces.items()
if status["oper"] == "up" and status["admin"] == "up"), None)
assert if_state_test_port is not None, "Unable to find valid interface for test"

ret = duthost.shell("config interface shutdown {}".format(IF_STATE_TEST_PORT))
assert ret["rc"] == 0, "Failing to shutdown interface {}".format(IF_STATE_TEST_PORT)
ret = duthost.shell("config interface shutdown {}".format(if_state_test_port))
assert ret["rc"] == 0, "Failing to shutdown interface {}".format(if_state_test_port)

ret = duthost.shell("config interface startup {}".format(IF_STATE_TEST_PORT))
assert ret["rc"] == 0, "Failing to startup interface {}".format(IF_STATE_TEST_PORT)
ret = duthost.shell("config interface startup {}".format(if_state_test_port))
assert ret["rc"] == 0, "Failing to startup interface {}".format(if_state_test_port)


def generate_pfc_storm(duthost):
Expand Down