Yang model support for SRV6 CRM (#9487)

#### Why I did it
To support Yang models for SRV6 CM

#### How I did it
Added yang models for SRV6 MY_SID_ENTRY and Nexthop

#### How to verify it
Added SRV6 CRM yang tests.

#### Which release branch to backport (provide reason below if selected)
202111
This commit is contained in:
Kumaresh Perumal 2022-07-31 22:09:44 -07:00 committed by GitHub
parent 6f323b3e83
commit d8f30c7bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 200 additions and 0 deletions

View File

@ -115,5 +115,43 @@
}, },
"MPLS_NH_WITH_CORRECT_USED_VALUE": { "MPLS_NH_WITH_CORRECT_USED_VALUE": {
"desc": "MPLS_NH_WITH_CORRECT_USED_VALUE no failure." "desc": "MPLS_NH_WITH_CORRECT_USED_VALUE no failure."
},
"SRV6_MY_SID_ENTRY_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "SRV6_MY_SID_ENTRY_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
},
"SRV6_MY_SID_ENTRY_WITH_WRONG_PERCENTAGE": {
"desc": "SRV6_MY_SID_ENTRY_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"SRV6_MY_SID_ENTRY_WITH_HIGH_THRESHOLD_ERR": {
"desc": "SRV6_MY_SID_ENTRY_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_MY_SID_ENTRY_WITH_CORRECT_USED_VALUE": {
"desc": "SRV6_MY_SID_ENTRY_WITH_CORRECT_USED_VALUE no failure."
},
"SRV6_MY_SID_ENTRY_WITH_CORRECT_FREE_VALUE": {
"desc": "SRV6_MY_SID_ENTRY_WITH_CORRECT_FREE_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_USED_VALUE": {
"desc": "SRV6_NH_WITH_CORRECT_USED_VALUE no failure."
} }
} }

View File

@ -328,5 +328,115 @@
} }
} }
} }
},
"SRV6_MY_SID_ENTRY_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_MY_SID_ENTRY_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_MY_SID_ENTRY_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_MY_SID_ENTRY_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_MY_SID_ENTRY_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"
}
}
}
} }
} }

View File

@ -404,6 +404,58 @@ module sonic-crm {
type threshold; type threshold;
} }
leaf srv6_my_sid_entry_threshold_type {
description "CRM threshold support for SRV6 my_sid entries";
must "(((current()='PERCENTAGE' or current()='percentage') and
../srv6_my_sid_entry_high_threshold<100 and
../srv6_my_sid_entry_low_threshold<100) or
(current()!='PERCENTAGE' and current()!='percentage'))";
type stypes:crm_threshold_type;
}
leaf srv6_my_sid_entry_high_threshold {
description "CRM threshold support for SRV6 my_sid entries";
must "(current() > ../srv6_my_sid_entry_low_threshold)"
{
error-message "high_threshold should be more than low_threshold";
}
type threshold;
}
leaf srv6_my_sid_entry_low_threshold {
description "CRM threshold support for SRV6 my_sid entries";
type threshold;
}
leaf srv6_nexthop_threshold_type {
description "CRM threshold support for SRV6 next-hops";
must "(((current()='PERCENTAGE' or current()='percentage') and
../srv6_nexthop_high_threshold<100 and
../srv6_nexthop_low_threshold<100) or
(current()!='PERCENTAGE' and current()!='percentage'))";
type stypes:crm_threshold_type;
}
leaf srv6_nexthop_high_threshold {
description "CRM threshold support for SRV6 next-hops";
must "(current() > ../srv6_nexthop_low_threshold)"
{
error-message "high_threshold should be more than low_threshold";
}
type threshold;
}
leaf srv6_nexthop_low_threshold {
description "CRM threshold support for SRV6 next-hops";
type threshold;
}
} }
/* end of Config */ /* end of Config */
} }