Skip to content

Commit

Permalink
Support LOSSLESS_TRAFFIC_PATTERN and DEFAULT_LOSSLESS_BUFFER_PARAMETER
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Sun <stephens@nvidia.com>
  • Loading branch information
stephenxs committed Jun 7, 2022
1 parent 8f47df6 commit 027b0fc
Show file tree
Hide file tree
Showing 8 changed files with 439 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def run(self):
'./yang-models/sonic-cable-length.yang',
'./yang-models/sonic-copp.yang',
'./yang-models/sonic-crm.yang',
'./yang-models/sonic-default-lossless-buffer-parameter.yang',
'./yang-models/sonic-device_metadata.yang',
'./yang-models/sonic-device_neighbor.yang',
'./yang-models/sonic-dhcpv6-relay.yang',
Expand All @@ -107,6 +108,7 @@ def run(self):
'./yang-models/sonic-interface.yang',
'./yang-models/sonic-kdump.yang',
'./yang-models/sonic-loopback-interface.yang',
'./yang-models/sonic-lossless-traffic-pattern.yang',
'./yang-models/sonic-mgmt_interface.yang',
'./yang-models/sonic-mgmt_port.yang',
'./yang-models/sonic-mgmt_vrf.yang',
Expand Down
14 changes: 14 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,20 @@
"LAG"
]
}
},

"LOSSLESS_TRAFFIC_PATTERN": {
"AZURE": {
"mtu": "1024",
"small_packet_percentage": "100"
}
},

"DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
"AZURE": {
"default_dynamic_th": "0",
"over_subscribe_ratio": "0"
}
}
},
"SAMPLE_CONFIG_DB_UNKNOWN": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_TEST": {
"desc": "Configure DEFAULT_LOSSLESS_BUFFER_PARAMETER table."
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_INVALID_NAME_TEST": {
"desc": "Configure DEFAULT_LOSSLESS_BUFFER_PARAMETER table with invalid character.",
"eStr": "Invalid default lossless buffer parameter list name."
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_TOO_LONG_NAME_TEST": {
"desc": "Configure DEFAULT_LOSSLESS_BUFFER_PARAMETER table with too long name.",
"eStr": "Invalid length for the default lossless buffer parameter list name."
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_TOO_SMALL_DYNAMIC_TH_TEST": {
"desc": "Configure DEFAULT_LOSSLESS_BUFFER_PARAMETER table with a dynamic_th exceeding the lowerbound.",
"eStr": "Invalid default dynamic_th which should be a number in the range [-8, 7]."
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_TOO_LARGE_DYNAMIC_TH_TEST": {
"desc": "Configure DEFAULT_LOSSLESS_BUFFER_PARAMETER table with a dynamic_th exceeding the upperbound.",
"eStr": "Invalid default dynamic_th which should be a number in the range [-8, 7]."
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_INVALID_FORMAT_DYNAMIC_TH_TEST": {
"desc": "Configure DEFAULT_LOSSLESS_BUFFER_PARAMETER table with an invalid dynamic_th",
"eStr": "Invalid"
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_LACK_DYNAMIC_TH_TEST": {
"desc": "Configure DEFAULT_LOSSLESS_BUFFER_PARAMETER table without dynamic_th",
"eStrKey" : "Mandatory"
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_INVALID_FORMAT_OVER_SUBSCRIBE_RATIO_TEST": {
"desc": "Configure DEFAULT_LOSSLESS_BUFFER_PARAMETER table with an invalid over subscribe ratio.",
"eStr": "Invalid"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"LOSSLESS_TRAFFIC_PATTERN_TEST": {
"desc": "Configure LOSSLESS_TRAFFIC_PATTERN table."
},
"LOSSLESS_TRAFFIC_PATTERN_INVALID_NAME_TEST": {
"desc": "Configure LOSSLESS_TRAFFIC_PATTERN table with invalid character.",
"eStr": "Invalid lossless traffic pattern list name."
},
"LOSSLESS_TRAFFIC_PATTERN_TOO_LONG_NAME_TEST": {
"desc": "Configure LOSSLESS_TRAFFIC_PATTERN table with too long name.",
"eStr": "Invalid length for the lossless traffic pattern list name."
},
"LOSSLESS_TRAFFIC_PATTERN_TOO_SMALL_MTU_TEST": {
"desc": "Configure LOSSLESS_TRAFFIC_PATTERN table with an MTU exceeding the lowerbound.",
"eStr": "Invaild MTU which should be in [64, 10240]."
},
"LOSSLESS_TRAFFIC_PATTERN_TOO_LARGE_MTU_TEST": {
"desc": "Configure LOSSLESS_TRAFFIC_PATTERN table with an MTU exceeding the upperbound.",
"eStr": "Invaild MTU which should be in [64, 10240]."
},
"LOSSLESS_TRAFFIC_PATTERN_INVALID_FORMAT_MTU_TEST": {
"desc": "Configure LOSSLESS_TRAFFIC_PATTERN table with an invalid MTU",
"eStr": "Invalid"
},
"LOSSLESS_TRAFFIC_PATTERN_LACK_MTU_TEST": {
"desc": "Configure LOSSLESS_TRAFFIC_PATTERN table without MTU",
"eStrKey": "Mandatory"
},
"LOSSLESS_TRAFFIC_PATTERN_TOO_LARGE_SMALL_PACKET_PERCENTAGE_TEST": {
"desc": "Configure LOSSLESS_TRAFFIC_PATTERN table with a small packet percentage exceeding the upperbound.",
"eStr": "Invalid small packets percentage which should be in [0, 100]."
},
"LOSSLESS_TRAFFIC_PATTERN_INVALID_FORMAT_SMALL_PACKET_PERCENTAGE_TEST": {
"desc": "Configure LOSSLESS_TRAFFIC_PATTERN table with an invalid small packet percentage",
"eStr": "Invalid"
},
"LOSSLESS_TRAFFIC_PATTERN_LACK_SMALL_PACKET_PERCENTAGE_TEST": {
"desc": "Configure LOSSLESS_TRAFFIC_PATTERN table without small packet percentage",
"eStrKey": "Mandatory"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_TEST": {
"sonic-default-lossless-buffer-parameter:sonic-default-lossless-buffer-parameter": {
"sonic-default-lossless-buffer-parameter:DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_LIST": [
{
"name": "AZURE",
"default_dynamic_th": "0",
"over_subscribe_ratio": "0"
}
]
}
}
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_INVALID_NAME_TEST": {
"sonic-default-lossless-buffer-parameter:sonic-default-lossless-buffer-parameter": {
"sonic-default-lossless-buffer-parameter:DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_LIST": [
{
"name": "Invalid$",
"default_dynamic_th": "0",
"over_subscribe_ratio": "0"
}
]
}
}
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_TOO_LONG_NAME_TEST": {
"sonic-default-lossless-buffer-parameter:sonic-default-lossless-buffer-parameter": {
"sonic-default-lossless-buffer-parameter:DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_LIST": [
{
"name": "Long_name_which_exceeds_the_limit",
"default_dynamic_th": "0",
"over_subscribe_ratio": "0"
}
]
}
}
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_TOO_SMALL_DYNAMIC_TH_TEST": {
"sonic-default-lossless-buffer-parameter:sonic-default-lossless-buffer-parameter": {
"sonic-default-lossless-buffer-parameter:DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_LIST": [
{
"name": "AZURE",
"default_dynamic_th": "-9",
"over_subscribe_ratio": "0"
}
]
}
}
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_TOO_LARGE_DYNAMIC_TH_TEST": {
"sonic-default-lossless-buffer-parameter:sonic-default-lossless-buffer-parameter": {
"sonic-default-lossless-buffer-parameter:DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_LIST": [
{
"name": "AZURE",
"default_dynamic_th": "8",
"over_subscribe_ratio": "0"
}
]
}
}
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_INVALID_FORMAT_DYNAMIC_TH_TEST": {
"sonic-default-lossless-buffer-parameter:sonic-default-lossless-buffer-parameter": {
"sonic-default-lossless-buffer-parameter:DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_LIST": [
{
"name": "AZURE",
"default_dynamic_th": "NaN",
"over_subscribe_ratio": "0"
}
]
}
}
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_LACK_DYNAMIC_TH_TEST": {
"sonic-default-lossless-buffer-parameter:sonic-default-lossless-buffer-parameter": {
"sonic-default-lossless-buffer-parameter:DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_LIST": [
{
"name": "AZURE",
"over_subscribe_ratio": "0"
}
]
}
}
},
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_INVALID_FORMAT_OVER_SUBSCRIBE_RATIO_TEST": {
"sonic-default-lossless-buffer-parameter:sonic-default-lossless-buffer-parameter": {
"sonic-default-lossless-buffer-parameter:DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
"DEFAULT_LOSSLESS_BUFFER_PARAMETER_LIST": [
{
"name": "AZURE",
"default_dynamic_th": "0",
"over_subscribe_ratio": "NaN"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{
"LOSSLESS_TRAFFIC_PATTERN_TEST": {
"sonic-lossless-traffic-pattern:sonic-lossless-traffic-pattern": {
"sonic-lossless-traffic-pattern:LOSSLESS_TRAFFIC_PATTERN": {
"LOSSLESS_TRAFFIC_PATTERN_LIST": [
{
"name": "AZURE",
"mtu": "1024",
"small_packet_percentage": "100"
}
]
}
}
},
"LOSSLESS_TRAFFIC_PATTERN_INVALID_NAME_TEST": {
"sonic-lossless-traffic-pattern:sonic-lossless-traffic-pattern": {
"sonic-lossless-traffic-pattern:LOSSLESS_TRAFFIC_PATTERN": {
"LOSSLESS_TRAFFIC_PATTERN_LIST": [
{
"name": "Invalid$",
"mtu": "1024",
"small_packet_percentage": "100"
}
]
}
}
},
"LOSSLESS_TRAFFIC_PATTERN_TOO_LONG_NAME_TEST": {
"sonic-lossless-traffic-pattern:sonic-lossless-traffic-pattern": {
"sonic-lossless-traffic-pattern:LOSSLESS_TRAFFIC_PATTERN": {
"LOSSLESS_TRAFFIC_PATTERN_LIST": [
{
"name": "Long_name_which_exceeds_the_limit",
"mtu": "1024",
"small_packet_percentage": "100"
}
]
}
}
},
"LOSSLESS_TRAFFIC_PATTERN_TOO_SMALL_MTU_TEST": {
"sonic-lossless-traffic-pattern:sonic-lossless-traffic-pattern": {
"sonic-lossless-traffic-pattern:LOSSLESS_TRAFFIC_PATTERN": {
"LOSSLESS_TRAFFIC_PATTERN_LIST": [
{
"name": "AZURE",
"mtu": "63",
"small_packet_percentage": "100"
}
]
}
}
},
"LOSSLESS_TRAFFIC_PATTERN_TOO_LARGE_MTU_TEST": {
"sonic-lossless-traffic-pattern:sonic-lossless-traffic-pattern": {
"sonic-lossless-traffic-pattern:LOSSLESS_TRAFFIC_PATTERN": {
"LOSSLESS_TRAFFIC_PATTERN_LIST": [
{
"name": "AZURE",
"mtu": "10241",
"small_packet_percentage": "100"
}
]
}
}
},
"LOSSLESS_TRAFFIC_PATTERN_INVALID_FORMAT_MTU_TEST": {
"sonic-lossless-traffic-pattern:sonic-lossless-traffic-pattern": {
"sonic-lossless-traffic-pattern:LOSSLESS_TRAFFIC_PATTERN": {
"LOSSLESS_TRAFFIC_PATTERN_LIST": [
{
"name": "AZURE",
"mtu": "NaN",
"small_packet_percentage": "100"
}
]
}
}
},
"LOSSLESS_TRAFFIC_PATTERN_LACK_MTU_TEST": {
"sonic-lossless-traffic-pattern:sonic-lossless-traffic-pattern": {
"sonic-lossless-traffic-pattern:LOSSLESS_TRAFFIC_PATTERN": {
"LOSSLESS_TRAFFIC_PATTERN_LIST": [
{
"name": "AZURE",
"small_packet_percentage": "100"
}
]
}
}
},
"LOSSLESS_TRAFFIC_PATTERN_TOO_LARGE_SMALL_PACKET_PERCENTAGE_TEST": {
"sonic-lossless-traffic-pattern:sonic-lossless-traffic-pattern": {
"sonic-lossless-traffic-pattern:LOSSLESS_TRAFFIC_PATTERN": {
"LOSSLESS_TRAFFIC_PATTERN_LIST": [
{
"name": "AZURE",
"mtu": "1024",
"small_packet_percentage": "101"
}
]
}
}
},
"LOSSLESS_TRAFFIC_PATTERN_INVALID_FORMAT_SMALL_PACKET_PERCENTAGE_TEST": {
"sonic-lossless-traffic-pattern:sonic-lossless-traffic-pattern": {
"sonic-lossless-traffic-pattern:LOSSLESS_TRAFFIC_PATTERN": {
"LOSSLESS_TRAFFIC_PATTERN_LIST": [
{
"name": "AZURE",
"mtu": "1024",
"small_packet_percentage": "NaN"
}
]
}
}
},
"LOSSLESS_TRAFFIC_PATTERN_LACK_SMALL_PACKET_PERCENTAGE_TEST": {
"sonic-lossless-traffic-pattern:sonic-lossless-traffic-pattern": {
"sonic-lossless-traffic-pattern:LOSSLESS_TRAFFIC_PATTERN": {
"LOSSLESS_TRAFFIC_PATTERN_LIST": [
{
"name": "AZURE",
"mtu": "1024"
}
]
}
}
}
}
Loading

0 comments on commit 027b0fc

Please sign in to comment.