Open amitpawar12 opened 6 days ago
The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.
Detailed pre-commit check results:
trim trailing whitespace.................................................PassedTo run the pre-commit checks locally, you can follow below steps:
pre-commit
package is installed:
sudo pip install pre-commit
pre-commit install
pre-commit
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
@sdszhang Please review.
Description of PR
PFCWD testcases should capture PFCWD statistics before and after the test.
The function get_pfcwd_config_attr was defined with one of the arguments as 'asic_value' but while calling the function, 'namespace' was being used. Corrected to use 'asic_value" while calling the get_pfcwd_config_attr function.
Summary: Fixes # (issue) Github issue #12900 Github issue #12987
Type of change
Back port request
Approach
What is the motivation for this PR?
The PFCWD statistics should be captured before and after the testcases to ensure that storm detected/restored is incremented during the test.
Similarly, the PFCWD drop counters should be also checked before and after the test to confirm the count of packets dropped during the test.
How did you do it?
Defined a function in tests/common/snappi_tests/common_helper.py to capture PFCWD stats for a given DUT, interface and priority. The function returns back all variables in form of a dictionary. If the stats are not present, then values are returned as zero for all the attributes.
The tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_basic_helper.py calls this function before and after the test and calculates the 'loss_packets' on the DUT, which is difference of TX_DROPS returned via PFCWD statistics.
The 'loss_packets' is sent as one of parameters for function 'verify_results'. The 'tgen_loss_packets' is capturing the loss packets which is difference of Tx - Rx packets on IXIA.
We can further enhance this to fail the testcase if the drops do not match.
How did you verify/test it?
Ran the testcases on local T2 chassis setup.
Truncated Code output: | Parameter:4_STORM_DETECTED, Initial Value:5, Final Value:5 | Parameter:4_RESTORED, Initial Value:5, Final Value:5 | Parameter:4_DROP, Initial Value:14092468, Final Value:14092468 | Parameter:4_TX_OK, Initial Value:20241318, Final Value:20241318 | Total PFCWD drop packets before and after the test:0 | TGEN Loss packets:0 `
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation