-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Split yang tests into multiple files #6939
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 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
acce8db
Add manageability to the yang model tests by splitting the tests
joyas-joseph 9e15665
Merge branch 'master' of github.com:Azure/sonic-buildimage into yang_…
joyas-joseph 30850c8
Update tests in sonic-yang-mgmt based on changes in sonig-yang-models
joyas-joseph 543db9f
Merge branch 'master' of github.com:Azure/sonic-buildimage into yang_…
joyas-joseph 39d4449
Update with latest test_sonic_yang.py
joyas-joseph dff550b
Address review comments.
joyas-joseph c5c37e6
Merge from azure/master
joyas-joseph d60b020
Update tests based on latest master
joyas-joseph c5934f6
Merge branch 'master' of github.com:Azure/sonic-buildimage into yang_…
joyas-joseph b6b7770
Merge branch 'master' of github.com:Azure/sonic-buildimage into yang_…
joyas-joseph 444d929
Resolve conflicts
joyas-joseph 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
313 changes: 37 additions & 276 deletions
313
src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py
Large diffs are not rendered by default.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
src/sonic-yang-models/tests/yang_model_tests/tests/acl.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,65 @@ | ||
| { | ||
| "ACL_RULE_UNDEFINED_PACKET_ACTION": { | ||
| "desc": "Configure undefined packet_action in ACL_RULE table.", | ||
| "eStrKey" : "InvalidValue", | ||
| "eStr": ["PACKET_ACTION"] | ||
| }, | ||
| "ACL_TABLE_EMPTY_PORTS": { | ||
| "desc": "Configure ACL_TABLE with empty ports." | ||
| }, | ||
| "ACL_TABLE_UNDEFINED_TABLE_TYPE": { | ||
| "desc": "Configure undefined acl_table_type in ACL_TABLE table.", | ||
| "eStrKey" : "InvalidValue", | ||
| "eStr": ["type"] | ||
| }, | ||
| "ACL_RULE_WITH_NON_EXIST_ACL_TABLE": { | ||
| "desc": "Configure non-existing ACL_TABLE in ACL_RULE.", | ||
| "eStrKey" : "LeafRef" | ||
| }, | ||
| "ACL_RULE_IP_TYPE_SRC_IPV6_MISMATCH": { | ||
| "desc": "Configure IP_TYPE as ipv4any and SRC_IPV6 in ACL_RULE.", | ||
| "eStrKey" : "When", | ||
| "eStr": ["IP_TYPE"] | ||
| }, | ||
| "ACL_RULE_ARP_TYPE_DST_IPV6_MISMATCH": { | ||
| "desc": "Configure IP_TYPE as ARP and DST_IPV6 in ACL_RULE.", | ||
| "eStrKey" : "When", | ||
| "eStr": ["IP_TYPE"] | ||
| }, | ||
| "ACL_RULE_WRONG_L4_SRC_PORT_RANGE": { | ||
| "desc": "Configure l4_src_port_range as 99999-99999 in ACL_RULE", | ||
| "eStrKey" : "Pattern" | ||
| }, | ||
| "ACL_RULE_ARP_TYPE_ICMPV6_CODE_MISMATCH": { | ||
| "desc": "Configure IP_TYPE as ARP and ICMPV6_CODE in ACL_RULE.", | ||
| "eStrKey" : "When", | ||
| "eStr": ["IP_TYPE"] | ||
| }, | ||
| "ACL_RULE_WRONG_INNER_ETHER_TYPE": { | ||
| "desc": "Configure INNER_ETHER_TYPE as 0x080C in ACL_RULE.", | ||
| "eStrKey" : "Pattern" | ||
| }, | ||
| "ACL_TABLE_MANDATORY_TYPE": { | ||
| "desc": "ACL_TABLE MANDATORY TYPE FIELD.", | ||
| "eStrKey" : "Mandatory", | ||
| "eStr": ["ACL_TABLE"] | ||
| }, | ||
| "ACL_TABLE_DEFAULT_VALUE_STAGE": { | ||
| "desc": "ACL_TABLE DEFAULT VALUE FOR STAGE FIELD.", | ||
| "eStrKey" : "Verify", | ||
| "verify": { | ||
| "xpath": "/sonic-acl:sonic-acl/ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4']/ACL_TABLE_NAME", | ||
| "key": "sonic-acl:stage", | ||
| "value": "INGRESS" | ||
| } | ||
| }, | ||
| "ACL_TABLE_STAGE_SERVICES": { | ||
| "desc": "ACL_TABLE LOAD STAGE SERVICES SUCCESSFULLY.", | ||
| "eStrKey" : "Verify", | ||
| "verify": { | ||
| "xpath": "/sonic-acl:sonic-acl/ACL_TABLE/ACL_TABLE_LIST[ACL_TABLE_NAME='NO-NSW-PACL-V4']/ACL_TABLE_NAME", | ||
| "key": "sonic-acl:services", | ||
| "value": ["SNMP"] | ||
| } | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
src/sonic-yang-models/tests/yang_model_tests/tests/breakout.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,12 @@ | ||
| { | ||
| "BREAKOUT_CFG_CORRECT_MODES": { | ||
| "desc": "BREAKOUT_CFG correct breakout modes" | ||
| }, | ||
| "BREAKOUT_CFG_INCORRECT_MODES": { | ||
| "desc": "BREAKOUT_CFG wrong breakout modes", | ||
| "eStr": ["pattern", "does not satisfy"] | ||
| }, | ||
| "CRM_BRK_CFG_FLEX_TABLE": { | ||
| "desc": "CRM BREAKOUT CFG FLEX COUNTER TABLE." | ||
| } | ||
| } |
81 changes: 81 additions & 0 deletions
81
src/sonic-yang-models/tests/yang_model_tests/tests/crm.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,81 @@ | ||
| { | ||
| "CRM_WITH_CORRECT_FREE_VALUE": { | ||
| "desc": "CRM_WITH_CORRECT_FREE_VALUE no failure." | ||
| }, | ||
| "CRM_WITH_CORRECT_USED_VALUE": { | ||
| "desc": "CRM_WITH_CORRECT_USED_VALUE no failure." | ||
| }, | ||
| "CRM_WITH_WRONG_THRESHOLD_TYPE": { | ||
| "desc": "CRM_WITH_WRONG_THRESHOLD_TYPE pattern failure.", | ||
| "eStrKey": "Pattern", | ||
| "eStr": ["wrong" ] | ||
| }, | ||
| "CRM_WITH_WRONG_PERCENTAGE": { | ||
| "desc": "CRM_WITH_WRONG_PERCENTAGE must condition failure.", | ||
| "eStrKey": "Must" | ||
| }, | ||
| "CRM_WITH_HIGH_THRESHOLD_ERR": { | ||
| "desc": "CRM_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", | ||
| "eStr": ["high_threshold should be more than low_threshold"] | ||
| }, | ||
| "CRM_WITH_CORRECT_USED_VALUE": { | ||
| "desc": "CRM_WITH_CORRECT_USED_VALUE no failure." | ||
| }, | ||
| "SNAT_WITH_WRONG_PERCENTAGE": { | ||
| "desc": "SNAT_WITH_WRONG_PERCENTAGE must condition failure.", | ||
| "eStrKey": "Must" | ||
| }, | ||
| "SNAT_WITH_HIGH_THRESHOLD_ERR": { | ||
| "desc": "SNAT_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", | ||
| "eStr": [ "high_threshold should be more than low_threshold" ] | ||
| }, | ||
| "SNAT_WITH_CORRECT_FREE_VALUE": { | ||
| "desc": "SNAT_WITH_CORRECT_FREE_VALUE no failure." | ||
| }, | ||
| "SNAT_WITH_CORRECT_USED_VALUE": { | ||
| "desc": "SNAT_WITH_CORRECT_USED_VALUE no failure." | ||
| }, | ||
| "SNAT_WITH_WRONG_THRESHOLD_TYPE": { | ||
| "desc": "SNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.", | ||
| "eStrKey": "Pattern", | ||
| "eStr": ["wrong" ] | ||
| }, | ||
| "DNAT_WITH_WRONG_PERCENTAGE": { | ||
| "desc": "DNAT_WITH_WRONG_PERCENTAGE must condition failure.", | ||
| "eStrKey": "Must" | ||
| }, | ||
| "DNAT_WITH_HIGH_THRESHOLD_ERR": { | ||
| "desc": "DNAT_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", | ||
| "eStr": [ "high_threshold should be more than low_threshold" ] | ||
| }, | ||
| "DNAT_WITH_CORRECT_FREE_VALUE": { | ||
| "desc": "DNAT_WITH_CORRECT_FREE_VALUE no failure." | ||
| }, | ||
| "DNAT_WITH_CORRECT_USED_VALUE": { | ||
| "desc": "DNAT_WITH_CORRECT_USED_VALUE no failure." | ||
| }, | ||
| "DNAT_WITH_WRONG_THRESHOLD_TYPE": { | ||
| "desc": "DNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.", | ||
| "eStrKey": "Pattern", | ||
| "eStr": ["wrong" ] | ||
| }, | ||
| "IPMC_WITH_WRONG_PERCENTAGE": { | ||
| "desc": "IPMC_WITH_WRONG_PERCENTAGE must condition failure.", | ||
| "eStrKey": "Must" | ||
| }, | ||
| "IPMC_WITH_HIGH_THRESHOLD_ERR": { | ||
| "desc": "IPMC_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.", | ||
| "eStr": [ "high_threshold should be more than low_threshold" ] | ||
| }, | ||
| "IPMC_WITH_CORRECT_FREE_VALUE": { | ||
| "desc": "IPMC_WITH_CORRECT_FREE_VALUE no failure." | ||
| }, | ||
| "IPMC_WITH_CORRECT_USED_VALUE": { | ||
| "desc": "IPMC_WITH_CORRECT_USED_VALUE no failure." | ||
| }, | ||
| "IPMC_WITH_WRONG_THRESHOLD_TYPE": { | ||
| "desc": "IPMC_WITH_WRONG_THRESHOLD_TYPE pattern failure.", | ||
| "eStrKey": "Pattern", | ||
| "eStr": ["wrong" ] | ||
| } | ||
| } | ||
36 changes: 36 additions & 0 deletions
36
src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.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,36 @@ | ||
| { | ||
| "DEV_META_DEV_NEIGH_VERSION_TABLE": { | ||
| "desc": "DEVICE_METADATA DEVICE_NEIGHBOR VERSION TABLE." | ||
| }, | ||
| "DEVICE_METADATA_DEFAULT_BGP_STATUS": { | ||
| "desc": "DEVICE_METADATA DEFAULT VALUE FOR BGP_STATUS FIELD.", | ||
| "eStrKey" : "Verify", | ||
| "verify": { | ||
| "xpath": "/sonic-device_metadata:sonic-device_metadata/DEVICE_METADATA/localhost/hostname", | ||
| "key": "sonic-device_metadata:default_bgp_status", | ||
| "value": "up" | ||
| } | ||
| }, | ||
| "DEVICE_METADATA_DEFAULT_DOCKER_ROUTING_CONFIG_MODE": { | ||
| "desc": "DEVICE_METADATA DEFAULT VALUE FOR DOCKER_ROUTING_CONFIG_MODE FIELD.", | ||
| "eStrKey" : "Verify", | ||
| "verify": { | ||
| "xpath": "/sonic-device_metadata:sonic-device_metadata/DEVICE_METADATA/localhost/hostname", | ||
| "key": "sonic-device_metadata:docker_routing_config_mode", | ||
| "value": "unified" | ||
| } | ||
| }, | ||
| "DEVICE_METADATA_DEFAULT_PFCWD_STATUS": { | ||
| "desc": "DEVICE_METADATA DEFAULT VALUE FOR PFCWD FIELD.", | ||
| "eStrKey" : "Verify", | ||
| "verify": { | ||
| "xpath": "/sonic-device_metadata:sonic-device_metadata/DEVICE_METADATA/localhost/hostname", | ||
| "key": "sonic-device_metadata:default_pfcwd_status", | ||
| "value": "disable" | ||
| } | ||
| }, | ||
| "DEVICE_METADATA_TYPE_INCORRECT_PATTERN": { | ||
| "desc": "DEVICE_METADATA_TYPE_INCORRECT_PATTERN pattern failure.", | ||
| "eStrKey" : "Pattern" | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
src/sonic-yang-models/tests/yang_model_tests/tests/flex_counter.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,5 @@ | ||
| { | ||
| "FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE": { | ||
| "desc": "FLEX_COUNTER_TABLE_WITH_CORRECT_USED_VALUE no failure." | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
src/sonic-yang-models/tests/yang_model_tests/tests/interface.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,14 @@ | ||
| { | ||
| "INTERFACE_IP_PREFIX_EMPTY_STRING": { | ||
| "desc": "Configure empty string as ip-prefix in INTERFACE table.", | ||
| "eStrKey": "InvalidValue", | ||
| "eStr": ["ip-prefix"] | ||
| }, | ||
| "INTERFACE_IPPREFIX_PORT_MUST_CONDITION_FALSE": { | ||
| "desc": "Interface Ip-prefix port-name must condition failure.", | ||
| "eStrKey": "Must" | ||
| }, | ||
| "INTERFACE_IPPREFIX_PORT_MUST_CONDITION_TRUE": { | ||
| "desc": "Interface Ip-prefix port-name must condition pass." | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
src/sonic-yang-models/tests/yang_model_tests/tests/loopback.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,6 @@ | ||
| { | ||
| "LOOPBACK_IPPREFIX_PORT_MUST_CONDITION_FALSE": { | ||
| "desc": "Loopback Ip-prefix port-name must condition failure.", | ||
| "eStrKey" : "Must" | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
src/sonic-yang-models/tests/yang_model_tests/tests/port.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,16 @@ | ||
| { | ||
| "PORT_TEST": { | ||
| "desc": "LOAD PORT TABLE WITH FEC AND PFC_ASYM SUCCESSFULLY. VERIFY PFC_ASYM.", | ||
| "eStrKey" : "Verify", | ||
| "verify": { | ||
| "xpath": "/sonic-port:sonic-port/PORT/PORT_LIST[name='Ethernet8']/name", | ||
| "key": "sonic-port:pfc_asym", | ||
| "value": "on" | ||
| } | ||
| }, | ||
| "PORT_NEG_TEST": { | ||
| "desc": "LOAD PORT TABLE FEC PATTERN FAILURE", | ||
| "eStrKey" : "Pattern", | ||
| "eStr": ["rc"] | ||
| } | ||
| } |
17 changes: 17 additions & 0 deletions
17
src/sonic-yang-models/tests/yang_model_tests/tests/portchannel.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,17 @@ | ||
| { | ||
| "PORT_CHANNEL_TEST": { | ||
| "desc": "Configure a member port in PORT_CHANNEL table." | ||
| }, | ||
| "PORT_CHANNEL_WRONG_PATTERN": { | ||
| "desc": "INCORRECT PORTCHANNEL_NAME IN PORT_CHANNEL TABLE.", | ||
| "eStrKey" : "Pattern", | ||
| "eStr": ["PortChannel"] | ||
| }, | ||
| "PORTCHANNEL_INTERFACE_IP_ADDR_TEST": { | ||
| "desc": "Configure IP address on PORTCHANNEL_INTERFACE table." | ||
| }, | ||
| "PORTCHANNEL_INTERFACE_IP_ADDR_ON_NON_EXIST_PO": { | ||
| "desc": "Configure IP address on a non existent PortChannel.", | ||
| "eStrKey": "LeafRef" | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
src/sonic-yang-models/tests/yang_model_tests/tests/versions.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,10 @@ | ||
| { | ||
| "VERSIONS_WITH_INCORRECT_PATTERN": { | ||
| "desc": "VERSIONS_WITH_INCORRECT_PATTERN pattern failure.", | ||
| "eStrKey" : "Pattern" | ||
| }, | ||
| "VERSIONS_WITH_INCORRECT_PATTERN2": { | ||
| "desc": "VERSIONS_WITH_INCORRECT_PATTERN pattern failure.", | ||
| "eStrKey" : "Pattern" | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
src/sonic-yang-models/tests/yang_model_tests/tests/vlan.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,33 @@ | ||
| { | ||
| "VLAN_INTERFACE_IPPREFIX_MUST_CONDITION_FALSE": { | ||
| "desc": "Vlan Interface Ip-prefix must condition failure.", | ||
| "eStrKey" : "Must" | ||
| }, | ||
| "INCORRECT_VLAN_NAME": { | ||
| "desc": "INCORRECT VLAN_NAME FIELD IN VLAN TABLE.", | ||
| "eStrKey" : "Pattern", | ||
| "eStr": ["Vlan"] | ||
| }, | ||
| "WRONG_FAMILY_WITH_IP_PREFIX": { | ||
| "desc": "Configure Wrong family with ip-prefix for VLAN_Interface Table", | ||
| "eStrKey" : "Must" | ||
| }, | ||
| "DHCP_SERVER_INCORRECT_FORMAT": { | ||
| "desc": "Add dhcp_server which is not in correct ip-prefix format.", | ||
| "eStrKey" : "InvalidValue", | ||
| "eStr": ["dhcp_servers"] | ||
| }, | ||
| "VLAN_WITH_NON_EXIST_PORT": { | ||
| "desc": "Configure a member port in VLAN_MEMBER table which does not exist.", | ||
| "eStrKey" : "LeafRef" | ||
| }, | ||
| "VLAN_MEMEBER_WITH_NON_EXIST_VLAN": { | ||
| "desc": "Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN table.", | ||
| "eStrKey" : "LeafRef" | ||
| }, | ||
| "TAGGING_MODE_WRONG_VALUE": { | ||
| "desc": "Configure wrong value for tagging_mode.", | ||
| "eStrKey" : "InvalidValue", | ||
| "eStr": ["tagging_mode"] | ||
| } | ||
| } |
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.