Skip to content
Merged
Show file tree
Hide file tree
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: 20 additions & 0 deletions tests/ixia/pfcwd/files/helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from tests.common.helpers.assertions import pytest_require
from tests.common.broadcom_data import is_broadcom_device

def skip_pfcwd_test(duthost, trigger_pfcwd):
"""
Skip PFC watchdog tests that may cause fake alerts

PFC watchdog on Broadcom devices use some approximation techniques to detect
PFC storms, which may cause some fake alerts. Therefore, we skip test cases
whose trigger_pfcwd is False for Broadcom devices.

Args:
duthost (obj): device to test
trigger_pfcwd (bool): if PFC watchdog is supposed to trigger

Returns:
N/A
"""
pytest_require(trigger_pfcwd is True or is_broadcom_device(duthost) is False,
'Skip trigger_pfcwd=False test cases for Broadcom devices')
3 changes: 3 additions & 0 deletions tests/ixia/pfcwd/test_pfcwd_a2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
lossless_prio_list, lossy_prio_list

from files.pfcwd_multi_node_helper import run_pfcwd_multi_node_test
from files.helper import skip_pfcwd_test

pytestmark = [ pytest.mark.topology('tgen') ]

Expand Down Expand Up @@ -50,6 +51,8 @@ def test_pfcwd_all_to_all(ixia_api,
"Priority and port are not mapped to the expected DUT")

duthost = duthosts[rand_one_dut_hostname]
skip_pfcwd_test(duthost=duthost, trigger_pfcwd=trigger_pfcwd)

testbed_config, port_config_list = ixia_testbed_config
lossless_prio = int(lossless_prio)

Expand Down
14 changes: 13 additions & 1 deletion tests/ixia/pfcwd/test_pfcwd_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from tests.common.reboot import reboot
from tests.common.utilities import wait_until
from files.pfcwd_basic_helper import run_pfcwd_basic_test

from files.helper import skip_pfcwd_test

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -50,6 +50,8 @@ def test_pfcwd_basic_single_lossless_prio(ixia_api,
"Priority and port are not mapped to the expected DUT")

duthost = duthosts[rand_one_dut_hostname]
skip_pfcwd_test(duthost=duthost, trigger_pfcwd=trigger_pfcwd)

testbed_config, port_config_list = ixia_testbed_config
lossless_prio = int(lossless_prio)

Expand Down Expand Up @@ -99,6 +101,8 @@ def test_pfcwd_basic_multi_lossless_prio(ixia_api,
"Port is not mapped to the expected DUT")

duthost = duthosts[rand_one_dut_hostname]
skip_pfcwd_test(duthost=duthost, trigger_pfcwd=trigger_pfcwd)

testbed_config, port_config_list = ixia_testbed_config

run_pfcwd_basic_test(api=ixia_api,
Expand Down Expand Up @@ -153,6 +157,8 @@ def test_pfcwd_basic_single_lossless_prio_reboot(ixia_api,
"Priority and port are not mapped to the expected DUT")

duthost = duthosts[rand_one_dut_hostname]
skip_pfcwd_test(duthost=duthost, trigger_pfcwd=trigger_pfcwd)

testbed_config, port_config_list = ixia_testbed_config
lossless_prio = int(lossless_prio)

Expand Down Expand Up @@ -214,6 +220,8 @@ def test_pfcwd_basic_multi_lossless_prio_reboot(ixia_api,
"Port is not mapped to the expected DUT")

duthost = duthosts[rand_one_dut_hostname]
skip_pfcwd_test(duthost=duthost, trigger_pfcwd=trigger_pfcwd)

testbed_config, port_config_list = ixia_testbed_config

logger.info("Issuing a {} reboot on the dut {}".format(reboot_type, duthost.hostname))
Expand Down Expand Up @@ -272,6 +280,8 @@ def test_pfcwd_basic_single_lossless_prio_service_restart(ixia_api,
"Priority and port are not mapped to the expected DUT")

duthost = duthosts[rand_one_dut_hostname]
skip_pfcwd_test(duthost=duthost, trigger_pfcwd=trigger_pfcwd)

testbed_config, port_config_list = ixia_testbed_config
lossless_prio = int(lossless_prio)

Expand Down Expand Up @@ -332,6 +342,8 @@ def test_pfcwd_basic_multi_lossless_prio_restart_service(ixia_api,
"Port is not mapped to the expected DUT")

duthost = duthosts[rand_one_dut_hostname]
skip_pfcwd_test(duthost=duthost, trigger_pfcwd=trigger_pfcwd)

testbed_config, port_config_list = ixia_testbed_config

logger.info("Issuing a restart of service {} on the dut {}".format(restart_service, duthost.hostname))
Expand Down
3 changes: 3 additions & 0 deletions tests/ixia/pfcwd/test_pfcwd_m2o.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
lossless_prio_list, lossy_prio_list

from files.pfcwd_multi_node_helper import run_pfcwd_multi_node_test
from files.helper import skip_pfcwd_test

pytestmark = [ pytest.mark.topology('tgen') ]

Expand Down Expand Up @@ -50,6 +51,8 @@ def test_pfcwd_many_to_one(ixia_api,
"Priority and port are not mapped to the expected DUT")

duthost = duthosts[rand_one_dut_hostname]
skip_pfcwd_test(duthost=duthost, trigger_pfcwd=trigger_pfcwd)

testbed_config, port_config_list = ixia_testbed_config
lossless_prio = int(lossless_prio)

Expand Down