-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PFC Watchdog Test Plan
The purpose is to test the functionality of PFC Watchdog on the SONIC switch DUT on Tor and Spine ports, closely resembling production environment. The test assumes all necessary configuration, PFC Watchdog, and BGP routes, are already pre-configured on the SONIC switch before test runs.
The test is targeting a running SONiC system with fully functioning configuration. Purpose of the test is to verify a SONiC switch system correctly detecting PFC storm, reacting on it according to the configuration.
Manual PFC WD configuration can be done using swssconfig utility in swss container.
swssconfig <json-file to apply>
PFC WD configuration should be created on the DUT before running the test. The test itself can be run using SONiC test.yml playbook with tag pfc_wd.
For the cases which test configuration, there will be a wfc_wd.json.j2 template.
pfc_wd.yaml will do the following:
- Generate JSON files and apply them on the switch.
- Run test.
- Clean up dynamic configuration and temporary configuration on the DUT.
PFC WD test consists of a number of subtests, and each of them will include the following steps:
- Run lognanalyzer 'init' phase
- Run PFC WD Sub Test
- Run loganalyzer 'analyze' phase
Subtests will test either a configuration or watchdog functionality.
Setup of SONIC DUT will be done by Ansible script. During setup, Ansible will copy JSON file containing configuration for Everflow to the swss container on the DUT. the swssconfig utility will be used to push the configuration to the SONiC DB. Data will be consumed by orchagent.
JSON Sample:
pfc_wd.json
[
{
"PFC_WD_TABLE:Ethernet0": {
"action": "drop",
"mitigation_time": "4000",
"restoration_time": "5000"
},
"OP": "SET"
}
]
In order to verify both actions (drop/forward), Traffic will be sent through a stormed port and expected to be forwarded or dropped respectively.
##Test cases
Each test case will be additionally validated by the loganalizer utility.
Some cases will add PFC WD configuration at the beginning and remove them at the end.
Verify that watchdog with forwarding action will be successfully configured and then removed from the specified port.
- Initialize log analyzer.
- Apply JSON file with WD configuration with forwarding action.
- Verify that log has the message saying that WD started on specified port.
- Initialize log analyzer.
- Apply JSON file with removal of WD configuration with forwarding action.
- Verify that log has the message saying that WD stopped on specified port.
Verify orchagent correctly handles invalid WD action field.
- Initialize log analyzer.
- Apply JSON file with WD action other than "drop"/"forward".
- Verify error in logs saying "Invalid PFC WD action".
Verify orchagent correctly handles invalid "mitigation_time" field.
- Initialize log analyzer.
- Apply JSON file with WD mitigation_time other than unsigned int.
- Verify error in logs saying "Invalid PFC WD action".
Verify orchagent correctly handles invalid "restoration_time" field.
- Initialize log analyzer.
- Apply JSON file with WD restoration_time other than unsigned int.
- Verify error in logs saying "Invalid PFC WD action".
Verify that WD is triggered under PFC storm and packets are forwarded from the interface.
- Initialize log analyzer.
- Apply JSON file with WD configuration with forwarding action.
- Verify that log has the message saying that WD started on specified port.
- Start sending traffic via the specified port.
- Initiate PFC storm on the specified port.
- Verify that traffic is forwarded.
- Stop PFC storm.
- Verify that logs contain the message that PFC WD was triggered on specified port/queue.
- Verify that logs contain the message that queue was restored from queue.
- Remove PFC WD configuration from port.
Verify that WD is triggered under PFC storm and packets are drop on the interface.
- Initialize log analyzer.
- Apply JSON file with WD configuration with the drop action.
- Verify that log has the message saying that WD started on specified port.
- Start sending traffic via the specified port.
- Verify that traffic is forwarded.
- Initiate PFC storm on the specified port.
- Verify that traffic is dropped.
- Stop PFC storm.
- Verify that logs contain the message that PFC WD was triggered on specified port/queue.
- Verify that logs contain the message that queue was restored from queue.
- Remove PFC WD configuration from port.
Verify that WD is triggered under PFC storm and packets are drop on the interface.
- Initialize log analyzer.
- Apply JSON file with WD configuration with the drop action.
- Verify that log has the message saying that WD started on specified port.
- Start sending traffic via the specified port.
- Verify that traffic is forwarded.
- Initiate PFC storm on the specified port.
- Verify that traffic is dropped.
- Stop PFC storm.
- Verify that logs contain the message that PFC WD was triggered on specified port/queue.
- Verify that logs contain the message that queue was restored from queue.
- Remove PFC WD configuration from port.
Verify that WD detects storm and restores queue within specified time constraints.
- Initialize log analyzer.
- Apply JSON file with WD configuration.
- Initiate PFC storm on the specified port.
- Stop PFC storm.
- Verify that WD was triggered within "mitigation_time".
- Verify that queue was restored after "restoration_time".
-
For Users
-
For Developers
-
Subgroups/Working Groups
-
Presentations
-
Join Us