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

Cisco-8000 test pfcwd function background traffic revision #15772

Merged
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
5 changes: 3 additions & 2 deletions tests/common/helpers/pfcwd_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from tests.ptf_runner import ptf_runner
from tests.common import constants
from tests.common.cisco_data import is_cisco_device
from tests.common.mellanox_data import is_mellanox_device

# If the version of the Python interpreter is greater or equal to 3, set the unicode variable to the str class.
Expand Down Expand Up @@ -490,15 +491,15 @@ def start_background_traffic(
@contextlib.contextmanager
def send_background_traffic(duthost, ptfhost, storm_hndle, selected_test_ports, test_ports_info):
"""Send background traffic, stop the background traffic when the context finish """
if is_mellanox_device(duthost):
if is_mellanox_device(duthost) or is_cisco_device(duthost):
background_traffic_params = _prepare_background_traffic_params(duthost, storm_hndle,
selected_test_ports,
test_ports_info)
background_traffic_log = _send_background_traffic(ptfhost, background_traffic_params)
# Ensure the background traffic is running before moving on
time.sleep(1)
yield
if is_mellanox_device(duthost):
if is_mellanox_device(duthost) or is_cisco_device(duthost):
_stop_background_traffic(ptfhost, background_traffic_log)


Expand Down
18 changes: 1 addition & 17 deletions tests/pfcwd/test_pfcwd_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ def storm_detect_path(self, dut, port, action):
if self.pfc_wd['fake_storm']:
PfcCmd.set_storm_status(dut, self.queue_oid, "enabled")

if dut.facts['asic_type'] == "mellanox":
if dut.facts['asic_type'] == ["mellanox", "cisco-8000"]:
# On Mellanox platform, more time is required for PFC storm being triggered
# as PFC pause sent from Non-Mellanox leaf fanout is not continuous sometimes.
PFC_STORM_TIMEOUT = 30
Expand All @@ -754,11 +754,6 @@ def storm_detect_path(self, dut, port, action):

# storm detect
logger.info("Verify if PFC storm is detected on port {}".format(port))
if dut.facts['asic_type'] == "cisco-8000":
# The function get_pkt_cnts() works only if pfcwd is triggered.
# When the WD is not triggered, this redis-cli command returns
# (nil), so this function call fails.
self.traffic_inst.verify_tx_egress(self.tx_action)
loganalyzer.analyze(marker)

self.stats.get_pkt_cnts(self.queue_oid, begin=True)
Expand Down Expand Up @@ -924,8 +919,6 @@ def test_pfcwd_actions(self, request, fake_storm, setup_pfc_test, setup_dut_test
logger.info("{} on port {}: Tx traffic action {}, Rx traffic action {} ".
format(WD_ACTION_MSG_PFX[action], port, self.tx_action, self.rx_action))
self.run_test(self.dut, port, action)
except Exception as e:
pytest.fail(str(e))

finally:
if self.storm_hndle:
Expand Down Expand Up @@ -1014,9 +1007,6 @@ def test_pfcwd_multi_port(self, request, fake_storm, setup_pfc_test, setup_dut_t
self.setup_test_params(port, setup_info['vlan'], init=not idx, detect=False, toggle=idx and count)
self.run_test(self.dut, port, "drop", detect=False)

except Exception as e:
pytest.fail(str(e))

finally:
logger.info("--- Stop PFC WD ---")
self.dut.command("pfcwd stop")
Expand Down Expand Up @@ -1106,9 +1096,6 @@ def test_pfcwd_mmu_change(self, request, fake_storm, setup_pfc_test, setup_dut_t
self.run_test(self.dut, port, "drop", mmu_action=mmu_action)
self.dut.command("pfcwd stop")

except Exception as e:
pytest.fail(str(e))

finally:
if self.storm_hndle:
logger.info("--- Stop pfc storm on port {}".format(port))
Expand Down Expand Up @@ -1214,9 +1201,6 @@ def test_pfcwd_port_toggle(self, request, fake_storm, setup_pfc_test, setup_dut_
if result["total"]["expected_missing_match"] == 0:
pytest.fail(result)

except Exception as e:
pytest.fail(str(e))

finally:
if self.storm_hndle:
logger.info("--- Stop PFC storm on port {}".format(port))
Expand Down
Loading