Skip to content
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

yang models fixed to make config apply-patch work #9517

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
127 changes: 81 additions & 46 deletions src/sonic-yang-models/tests/yang_model_tests/tests/crm.json
Original file line number Diff line number Diff line change
@@ -1,119 +1,154 @@
{
"CRM_WITH_CORRECT_FREE_VALUE": {
"desc": "CRM_WITH_CORRECT_FREE_VALUE no failure."
"desc": "CRM_WITH_CORRECT_FREE_VALUE no failure."
},
"CRM_WITH_CORRECT_USED_VALUE": {
"desc": "CRM_WITH_CORRECT_USED_VALUE no failure."
"desc": "CRM_WITH_CORRECT_USED_VALUE no failure."
},
"CRM_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "CRM_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"desc": "CRM_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
"eStr": ["wrong" ]
},
"CRM_WITH_WRONG_PERCENTAGE": {
"desc": "CRM_WITH_WRONG_PERCENTAGE must condition failure.",
"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."
"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"]
},
"SNAT_WITH_WRONG_PERCENTAGE": {
"desc": "SNAT_WITH_WRONG_PERCENTAGE must condition failure.",
"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" ]
"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."
"desc": "SNAT_WITH_CORRECT_FREE_VALUE no failure."
},
"SNAT_WITH_CORRECT_USED_VALUE": {
"desc": "SNAT_WITH_CORRECT_USED_VALUE no failure."
"desc": "SNAT_WITH_CORRECT_USED_VALUE no failure."
},
"SNAT_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "SNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"desc": "SNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
"eStr": ["wrong" ]
},
"DNAT_WITH_WRONG_PERCENTAGE": {
"desc": "DNAT_WITH_WRONG_PERCENTAGE must condition failure.",
"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" ]
"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."
"desc": "DNAT_WITH_CORRECT_FREE_VALUE no failure."
},
"DNAT_WITH_CORRECT_USED_VALUE": {
"desc": "DNAT_WITH_CORRECT_USED_VALUE no failure."
"desc": "DNAT_WITH_CORRECT_USED_VALUE no failure."
},
"DNAT_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "DNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"desc": "DNAT_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
"eStr": ["wrong" ]
},
"IPMC_WITH_WRONG_PERCENTAGE": {
"desc": "IPMC_WITH_WRONG_PERCENTAGE must condition failure.",
"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" ]
"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."
"desc": "IPMC_WITH_CORRECT_FREE_VALUE no failure."
},
"IPMC_WITH_CORRECT_USED_VALUE": {
"desc": "IPMC_WITH_CORRECT_USED_VALUE no failure."
"desc": "IPMC_WITH_CORRECT_USED_VALUE no failure."
},
"IPMC_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "IPMC_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"desc": "IPMC_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
"eStr": ["wrong" ]
},
"MPLS_INSEG_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "MPLS_INSEG_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"desc": "MPLS_INSEG_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
"eStr": ["wrong" ]
},
"MPLS_INSEG_WITH_WRONG_PERCENTAGE": {
"desc": "MPLS_INSEG_WITH_WRONG_PERCENTAGE must condition failure.",
"desc": "MPLS_INSEG_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"MPLS_INSEG_WITH_HIGH_THRESHOLD_ERR": {
"desc": "MPLS_INSEG_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": ["high_threshold should be more than low_threshold"]
"desc": "MPLS_INSEG_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": ["high_threshold should be more than low_threshold"]
},
"MPLS_INSEG_WITH_CORRECT_USED_VALUE": {
"desc": "MPLS_INSEG_WITH_CORRECT_USED_VALUE no failure."
"desc": "MPLS_INSEG_WITH_CORRECT_USED_VALUE no failure."
},
"MPLS_INSEG_WITH_CORRECT_FREE_VALUE": {
"desc": "MPLS_INSEG_WITH_CORRECT_FREE_VALUE no failure."
"desc": "MPLS_INSEG_WITH_CORRECT_FREE_VALUE no failure."
},
"MPLS_NH_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "MPLS_NH_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"desc": "MPLS_NH_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
"eStr": ["wrong" ]
},
"MPLS_NH_WITH_WRONG_PERCENTAGE": {
"desc": "MPLS_NH_WITH_WRONG_PERCENTAGE must condition failure.",
"desc": "MPLS_NH_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"MPLS_NH_WITH_HIGH_THRESHOLD_ERR": {
"desc": "MPLS_NH_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": ["high_threshold should be more than low_threshold"]
"desc": "MPLS_NH_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": ["high_threshold should be more than low_threshold"]
},
"MPLS_NH_WITH_CORRECT_USED_VALUE": {
"desc": "MPLS_NH_WITH_CORRECT_USED_VALUE no failure."
"desc": "MPLS_NH_WITH_CORRECT_USED_VALUE no failure."
},
"MPLS_NH_WITH_CORRECT_USED_VALUE": {
"desc": "MPLS_NH_WITH_CORRECT_USED_VALUE no failure."
"MPLS_NH_WITH_CORRECT_FREE_VALUE": {
"desc": "MPLS_NH_WITH_CORRECT_USED_VALUE no failure."
},
"SRV6_NH_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "SRV6_NH_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
},
"SRV6_NH_WITH_WRONG_PERCENTAGE": {
"desc": "SRV6_NH_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"SRV6_NH_WITH_HIGH_THRESHOLD_ERR": {
"desc": "SRV6_NH_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": ["high_threshold should be more than low_threshold"]
},
"SRV6_NH_WITH_CORRECT_USED_VALUE": {
"desc": "SRV6_NH_WITH_CORRECT_USED_VALUE no failure."
},
"SRV6_NH_WITH_CORRECT_FREE_VALUE": {
"desc": "SRV6_NH_WITH_CORRECT_USED_VALUE no failure."
},
"SRV6_MSE_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "SRV6_MSE_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
},
"SRV6_MSE_WITH_WRONG_PERCENTAGE": {
"desc": "SRV6_MSE_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"SRV6_MSE_WITH_HIGH_THRESHOLD_ERR": {
"desc": "SRV6_MSE_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": ["high_threshold should be more than low_threshold"]
},
"SRV6_MSE_WITH_CORRECT_USED_VALUE": {
"desc": "SRV6_MSE_WITH_CORRECT_USED_VALUE no failure."
},
"SRV6_MSE_WITH_CORRECT_FREE_VALUE": {
"desc": "SRV6_MSE_WITH_CORRECT_USED_VALUE no failure."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"SFLOW_TEST_EXCEEDING_MAX_ELEMENTS": {
"desc": "Configure collectors above the specified limit in SFLOW_COLLECTOR table.",
"eStr": ["Too many \"SFLOW_COLLECTOR_LIST\" elements"]
"eStr": ["Too many \"SFLOW_COLLECTOR_LIST\" elements"]
},
"SFLOW_SESSION_TEST": {
"desc": "Configure a sflow session in SFLOW_SESSION table."
Expand Down
110 changes: 110 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/crm.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,5 +328,115 @@
}
}
}
},
"SRV6_MSE_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"srv6_my_sid_entry_high_threshold": 90,
"srv6_my_sid_entry_low_threshold": 70,
"srv6_my_sid_entry_threshold_type": "free"
}
}
}
},
"SRV6_MSE_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"srv6_my_sid_entry_high_threshold": 85,
"srv6_my_sid_entry_low_threshold": 25,
"srv6_my_sid_entry_threshold_type": "used"
}
}
}
},
"SRV6_MSE_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"srv6_my_sid_entry_high_threshold": 80,
"srv6_my_sid_entry_low_threshold": 81,
"srv6_my_sid_entry_threshold_type": "PERCENTAGE"
}
}
}
},
"SRV6_MSE_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"srv6_my_sid_entry_high_threshold": 110,
"srv6_my_sid_entry_low_threshold": 85,
"srv6_my_sid_entry_threshold_type": "PERCENTAGE"
}
}
}
},
"SRV6_MSE_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"srv6_my_sid_entry_high_threshold": 90,
"srv6_my_sid_entry_low_threshold": 70,
"srv6_my_sid_entry_threshold_type": "wrong"
}
}
}
},
"SRV6_NH_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"srv6_nexthop_high_threshold": 90,
"srv6_nexthop_low_threshold": 70,
"srv6_nexthop_threshold_type": "free"
}
}
}
},
"SRV6_NH_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"srv6_nexthop_high_threshold": 85,
"srv6_nexthop_low_threshold": 25,
"srv6_nexthop_threshold_type": "used"
}
}
}
},
"SRV6_NH_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"srv6_nexthop_high_threshold": 80,
"srv6_nexthop_low_threshold": 81,
"srv6_nexthop_threshold_type": "PERCENTAGE"
}
}
}
},
"SRV6_NH_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"srv6_nexthop_high_threshold": 110,
"srv6_nexthop_low_threshold": 85,
"srv6_nexthop_threshold_type": "PERCENTAGE"
}
}
}
},
"SRV6_NH_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"srv6_nexthop_high_threshold": 90,
"srv6_nexthop_low_threshold": 70,
"srv6_nexthop_threshold_type": "wrong"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
{
"name": "collector1",
"collector_ip": "10.100.12.13",
"collector_port": "6343"
"collector_port": "6343",
"collector_vrf": "default"
}
]
}
Expand Down Expand Up @@ -46,11 +47,11 @@
"name": "collector1",
"collector_ip": "10.100.12.13"
},
{
{
"name": "collector2",
"collector_ip": "10.144.1.2"
},
{
{
"name": "collector3",
"collector_ip": "10.100.12.15"
}
Expand All @@ -60,7 +61,7 @@
},

"SFLOW_SESSION_TEST": {
"sonic-port:sonic-port": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
Expand Down