Skip to content

Commit 01df943

Browse files
stephenxsmssonicbld
authored andcommitted
Support dot in the additional information of the PFC watchdog event in the yang model (sonic-net#18235)
### Why I did it Support dot (`.`) in the `additional_info` field in the PFC watchdog event in the yang model. The `additional_info` field was introduced to represent diagnosis information when a PFC storm is detected, which can include fragments. Signed-off-by: Stephen Sun <[email protected]> ### How I did it #### How to verify it Unit test.
1 parent 34c9532 commit 01df943

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
"SONIC_EVENTS_SWSS_PFC_STORM_VALID_WITH_ADDITIONAL_INFO": {
4141
"desc": "VALID IF_STATE EVENT."
4242
},
43+
"SONIC_EVENTS_SWSS_PFC_STORM_VALID_WITH_ADDITIONAL_INFO_FRAGMENT": {
44+
"desc": "VALID IF_STATE EVENT."
45+
},
4346
"SONIC_EVENTS_SWSS_PFC_STORM_WITH_INVALID_ADDITIONAL_INFO_1": {
4447
"desc": "PFC_STORM_EVENT_INCORRECT_ADDITIONAL_INFO failure.",
4548
"eStrKey": "Pattern"

src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@
113113
}
114114
}
115115
},
116+
"SONIC_EVENTS_SWSS_PFC_STORM_VALID_WITH_ADDITIONAL_INFO_FRAGMENT": {
117+
"sonic-events-swss:sonic-events-swss": {
118+
"sonic-events-swss:pfc-storm": {
119+
"ifname": "Ethernet0",
120+
"queue_index": 0,
121+
"queue_id": 0,
122+
"port_id": 0,
123+
"additional_info": "info1:1.2|info2:3.25",
124+
"timestamp": "1985-04-12T23:20:50.52Z"
125+
}
126+
}
127+
},
116128
"SONIC_EVENTS_SWSS_PFC_STORM_WITH_INVALID_ADDITIONAL_INFO_1": {
117129
"sonic-events-swss:sonic-events-swss": {
118130
"sonic-events-swss:pfc-storm": {

src/sonic-yang-models/yang-models/sonic-events-swss.yang

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module sonic-events-swss {
8080

8181
leaf additional_info {
8282
type string {
83-
pattern '[-a-zA-Z0-9_]+:[-a-zA-Z0-9_]+(\|{1}[-a-zA-Z0-9_]+:[-a-zA-Z0-9_]+)*';
83+
pattern '[-a-zA-Z0-9_]+:[-a-zA-Z0-9_.]+(\|{1}[-a-zA-Z0-9_]+:[-a-zA-Z0-9_.]+)*';
8484
}
8585
description "Additional information to investigate PFC storm";
8686
}

0 commit comments

Comments
 (0)