diff --git a/tests/common/helpers/pfc_gen.py b/tests/common/helpers/pfc_gen.py index de87f7305c7..4e26ec26ae1 100755 --- a/tests/common/helpers/pfc_gen.py +++ b/tests/common/helpers/pfc_gen.py @@ -172,7 +172,7 @@ def main(): packet = packet + b"\x00\x00" pre_str = 'GLOBAL_PF' if options.global_pf else 'PFC' - logger.debug(pre_str + '_STORM_START') + logger.debug(pre_str + '_STORM_DEBUG') # Start sending PFC pause frames senders = [] @@ -186,6 +186,7 @@ def main(): s.start() senders.append(s) + logger.debug(pre_str + '_STORM_START') # Wait PFC packets to be sent for sender in senders: sender.stop() diff --git a/tests/pfcwd/test_pfcwd_timer_accuracy.py b/tests/pfcwd/test_pfcwd_timer_accuracy.py index 359cc400a09..32587fbdbdc 100644 --- a/tests/pfcwd/test_pfcwd_timer_accuracy.py +++ b/tests/pfcwd/test_pfcwd_timer_accuracy.py @@ -227,19 +227,29 @@ def verify_pfcwd_timers(self): logger.info("all restore time {}".format(self.all_restore_time)) check_point = ITERATION_NUM // 2 - 1 + config_detect_time = self.timers['pfc_wd_detect_time'] + self.timers['pfc_wd_poll_time'] # Loose the check if two conditions are met - # 1. Device is Mellanox plaform - # 2. Leaf-fanout is Non-Onyx or non-Mellanox SONiC devices + # 1. Leaf-fanout is Non-Onyx or non-Mellanox SONiC devices + # 2. Device is Mellanox plaform, Loose the check + # 3. Device is broadcom plaform, add half of polling time as compensation for the detect config time # It's because the pfc_gen.py running on leaf-fanout can't guarantee the PFCWD is triggered consistently - if self.dut.facts['asic_type'] == "mellanox": - for fanouthost in list(self.fanout.values()): - if fanouthost.get_fanout_os() != "onyx" or \ - fanouthost.get_fanout_os() == "sonic" and fanouthost.facts['asic_type'] != "mellanox": + logger.debug("dut asic_type {}".format(self.dut.facts['asic_type'])) + for fanouthost in list(self.fanout.values()): + if fanouthost.get_fanout_os() != "onyx" or \ + fanouthost.get_fanout_os() == "sonic" and fanouthost.facts['asic_type'] != "mellanox": + if self.dut.facts['asic_type'] == "mellanox": logger.info("Loose the check for non-Onyx or non-Mellanox leaf-fanout testbed") check_point = ITERATION_NUM // 3 - 1 break + elif self.dut.facts['asic_type'] == "broadcom": + logger.info("Configuring detect time for broadcom DUT") + config_detect_time = ( + self.timers['pfc_wd_detect_time'] + + self.timers['pfc_wd_poll_time'] + + (self.timers['pfc_wd_poll_time'] // 2) + ) + break - config_detect_time = self.timers['pfc_wd_detect_time'] + self.timers['pfc_wd_poll_time'] err_msg = ("Real detection time is greater than configured: Real detect time: {} " "Expected: {} (wd_detect_time + wd_poll_time)".format(self.all_detect_time[check_point], config_detect_time))