forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONiC Yang model for sFlow feature (sonic-net#7473)
* SONiC YANG model support for sFlow feature. Signed-off-by: Arthi Sivanantham <arthi_sivanantham@dell.com>
- Loading branch information
1 parent
1f8e725
commit a89087b
Showing
5 changed files
with
445 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/sonic-yang-models/tests/yang_model_tests/tests/sflow.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"SFLOW_COLLECTOR_TEST": { | ||
"desc": "Configure a collector in SFLOW_COLLECTOR table." | ||
}, | ||
"SFLOW_COLLECTOR_WRONG_NAME_TEST": { | ||
"desc": "Configure a collector with incorrect name in SFLOW_COLLECTOR table.", | ||
"eStr" : ["not", "satisfy", "the", "constraint", "1..64"] | ||
}, | ||
"SFLOW_TEST_WITHOUT_COLLECTOR_IP": { | ||
"desc": "Configure a collector without collector IP attribute in SFLOW_COLLECTOR table.", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"SFLOW_TEST_EXCEEDING_MAX_ELEMENTS": { | ||
"desc": "Configure collectors above the specified limit in SFLOW_COLLECTOR table.", | ||
"eStr": ["Too many \"SFLOW_COLLECTOR_LIST\" elements"] | ||
}, | ||
"SFLOW_SESSION_TEST": { | ||
"desc": "Configure a sflow session in SFLOW_SESSION table." | ||
}, | ||
"SFLOW_SESSION_TEST_WITH_NON_EXIST_PORT": { | ||
"desc": "Configure Port in SFLOW_SESSION table which does not exist in PORT table.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"SFLOW_SESSION_TEST_WITH_INCORRECT_PORT_NAME_PATTERN": { | ||
"desc": "Configure SFLOW_SESSION table with incorrect pattern in port name attribute.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"SFLOW_SESSION_TEST_WITH_INCORRECT_SAMPLE_RATE": { | ||
"desc": "Configure sflow session in SFLOW_SESSION table with an out of range sample rate.", | ||
"eStr": ["sFlow sample rate must be [256-8388608]"] | ||
}, | ||
"SFLOW_SESSION_TEST_WITH_INCORRECT_PORT_TYPE_IN_SAMPLE_RATE": { | ||
"desc": "Configure sflow session in SFLOW_SESSION table with an incorrect port type in sample rate.", | ||
"eStrKey": "Must" | ||
}, | ||
"SFLOW_TEST": { | ||
"desc": "Configure sflow global entry in SFLOW table." | ||
}, | ||
"SFLOW_TEST_WITH_NON_EXIST_PORT": { | ||
"desc": "Configure Port in SFLOW table which does not exist in PORT table.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"SFLOW_TEST_WITH_INCORRECT_POLLING_INTERVAL": { | ||
"desc": "Configure SFLOW table with an out of range polling interval.", | ||
"eStr": ["sFlow polling interval must be [0, 5-300]"] | ||
} | ||
} |
225 changes: 225 additions & 0 deletions
225
src/sonic-yang-models/tests/yang_model_tests/tests_config/sflow.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,225 @@ | ||
{ | ||
"SFLOW_COLLECTOR_TEST": { | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW_COLLECTOR": { | ||
"SFLOW_COLLECTOR_LIST": [ | ||
{ | ||
"name": "collector1", | ||
"collector_ip": "10.100.12.13", | ||
"collector_port": "6343" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_COLLECTOR_WRONG_NAME_TEST": { | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW_COLLECTOR": { | ||
"SFLOW_COLLECTOR_LIST": [ | ||
{ | ||
"name": "collector1111111111111111111111111111111111111111111111111111111111111111", | ||
"collector_ip": "10.100.12.13" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_TEST_WITHOUT_COLLECTOR_IP": { | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW_COLLECTOR": { | ||
"SFLOW_COLLECTOR_LIST": [ | ||
{ | ||
"name": "collector1" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_TEST_EXCEEDING_MAX_ELEMENTS": { | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW_COLLECTOR": { | ||
"SFLOW_COLLECTOR_LIST": [ | ||
{ | ||
"name": "collector1", | ||
"collector_ip": "10.100.12.13" | ||
}, | ||
{ | ||
"name": "collector2", | ||
"collector_ip": "10.144.1.2" | ||
}, | ||
{ | ||
"name": "collector3", | ||
"collector_ip": "10.100.12.15" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_SESSION_TEST": { | ||
"sonic-port:sonic-port": { | ||
"sonic-port:PORT": { | ||
"PORT_LIST": [ | ||
{ | ||
"admin_status": "up", | ||
"alias": "eth0", | ||
"description": "Ethernet0", | ||
"lanes": "65", | ||
"mtu": 9000, | ||
"name": "Ethernet0", | ||
"speed": 25000 | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW_SESSION": { | ||
"SFLOW_SESSION_LIST": [ | ||
{ | ||
"port": "Ethernet0", | ||
"admin_state": "up", | ||
"sample_rate": "40000" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_SESSION_TEST_WITH_NON_EXIST_PORT": { | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW_SESSION": { | ||
"SFLOW_SESSION_LIST": [ | ||
{ | ||
"port": "Ethernet4", | ||
"admin_state": "down", | ||
"sample_rate": "32768" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_SESSION_TEST_WITH_INCORRECT_PORT_NAME_PATTERN": { | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW_SESSION": { | ||
"SFLOW_SESSION_LIST": [ | ||
{ | ||
"port": "allllll", | ||
"admin_state": "down" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_SESSION_TEST_WITH_INCORRECT_SAMPLE_RATE": { | ||
"sonic-port:sonic-port": { | ||
"sonic-port:PORT": { | ||
"PORT_LIST": [ | ||
{ | ||
"admin_status": "up", | ||
"alias": "eth0", | ||
"description": "Ethernet0", | ||
"lanes": "65", | ||
"mtu": 9000, | ||
"name": "Ethernet0", | ||
"speed": 25000 | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW_SESSION": { | ||
"SFLOW_SESSION_LIST": [ | ||
{ | ||
"port": "Ethernet0", | ||
"admin_state": "up", | ||
"sample_rate": "40" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_SESSION_TEST_WITH_INCORRECT_PORT_TYPE_IN_SAMPLE_RATE": { | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW_SESSION": { | ||
"SFLOW_SESSION_LIST": [ | ||
{ | ||
"port": "all", | ||
"admin_state": "up", | ||
"sample_rate": "40000" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_TEST": { | ||
"sonic-port:sonic-port": { | ||
"sonic-port:PORT": { | ||
"PORT_LIST": [ | ||
{ | ||
"admin_status": "up", | ||
"alias": "eth0", | ||
"description": "Ethernet0", | ||
"lanes": "65", | ||
"mtu": 9000, | ||
"name": "Ethernet0", | ||
"speed": 25000 | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW": { | ||
"global": { | ||
"agent_id": "Ethernet0", | ||
"admin_state": "up", | ||
"polling_interval": "20" | ||
} | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_TEST_WITH_NON_EXIST_PORT": { | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW": { | ||
"global": { | ||
"agent_id": "Ethernet0", | ||
"admin_state": "up", | ||
"polling_interval": "20" | ||
} | ||
} | ||
} | ||
}, | ||
|
||
"SFLOW_TEST_WITH_INCORRECT_POLLING_INTERVAL": { | ||
"sonic-port:sonic-port": { | ||
"sonic-port:PORT": { | ||
"PORT_LIST": [ | ||
{ | ||
"admin_status": "up", | ||
"alias": "eth0", | ||
"description": "Ethernet0", | ||
"lanes": "65", | ||
"mtu": 9000, | ||
"name": "Ethernet0", | ||
"speed": 25000 | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-sflow:sonic-sflow": { | ||
"sonic-sflow:SFLOW": { | ||
"global": { | ||
"admin_state": "up", | ||
"polling_interval": "305" | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.