-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SONiC Yang model for sFlow feature #7473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ad2ace4
SONiC Yang models for sFlow, AAA and TACACS features
046de4b
Merge branch 'master' into sonic_yangs
3c4c20e
Added description for attributes
2a15653
Merge branch 'master' into sonic_yangs
5ac683f
1. Include PortChannel type in sflow agent id. 2. Fix import prefixes
44cc511
Merge branch 'master' into sonic_yangs
9903928
Retain only sflow changes
d06946a
Merge branch 'master' into sonic_yangs
5f75b44
Modify setup.py to include sflow
b046994
Merge branch 'master' into sonic_yangs
6fa7e09
Merge branch 'master' into sonic_yangs
5e3fd6a
Include sflow in setup.py
59d9510
Update key of sflow session to inlude interface all case
194e062
Merge branch 'master' into sonic_yangs
b1b6822
Merge branch 'master' into sonic_yangs
62918c7
Modify type of vlan to string due to build issues
7341f78
Merge branch 'master' into sonic_yangs
698ccce
1. Add must statement for sflow session sample rate.
fa0cd32
Add description for sflow session table all key
5c459dd
Fix build issues
9a1a068
Merge branch 'master' into sonic_yangs
6487d32
Fix test case attributes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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]"] | ||
| } | ||
| } |
226 changes: 226 additions & 0 deletions
226
src/sonic-yang-models/tests/yang_model_tests/tests_config/sflow.json
This file contains hidden or 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,226 @@ | ||
| { | ||
| "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": { | ||
| "agent_id": "Ethernet0", | ||
ArthiSivanantham marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "admin_state": "up", | ||
| "polling_interval": "305" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.