-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
sonic-yang-models updates for MPLS #7881
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,13 @@ module sonic-interface { | |
} | ||
default "0"; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add Yang model tests for mpls enable/disable on RIFs? Most of tests are in sonic-yang-models/tests/yang_model_tests/tests There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kperumalbfn I looked at the types of tests currently under sonic-yang-models. It looked like it was mostly parameter validation. Since this mpls knob has two fixed values, I wasn't sure what more needed to be checked for that. Do you have something specific in mind? Can you provide a pointer to an example? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it will be good to have a test for one type of interface. SAI default value for SAI_ROUTER_INTERFACE_ATTR_ADMIN_MPLS_STATE is disabled, we can use that. There are examples for NAT_ZONE in sonic-yang-models/tests/yang_model_tests/tests/interface.json There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kperumalbfn Type for mpls attribute has been changed from string to enum, which I believe should eliminate the need for valid/invalid attribute value tests. No explicit default should be defined in yang models due to lack of support for this atttribute in many existing platforms. |
||
leaf mpls { | ||
description "Enable/disable MPLS routing for the interface"; | ||
type enumeration { | ||
enum enable; | ||
enum disable; | ||
} | ||
} | ||
} | ||
/* end of INTERFACE_LIST */ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,13 @@ module sonic-vlan { | |
} | ||
default "0"; | ||
} | ||
leaf mpls { | ||
description "Enable/disable MPLS routing for the vlan interface"; | ||
type enumeration { | ||
enum enable; | ||
enum disable; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed in the meeting, please define typedef for enable/disable and use it here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @venkatmahalingam There seems to be some inconsistency with regards to typedefs in sonic-yang-models. I see instances of enable/disable enum in sonic-device_metadata.yang and sonic-flex_counter.yang without a generic typedef being referenced. Also, I see that sonic-types.yang now requires a revision. I would suggest that a new revision of sonic-types.yang that incorporates a generic enable/disable typedef should be outside of the scope of this PR and done as a general cleanup of the yang_models to avoid churn on yang revisions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why can't we add typedef for enable/disable in the sonic-types.yang and use it in this YANG? we can correct typedef in the other modules later? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @venkatmahalingam Presumably any addition to sonic-types.yang requires a new revision for that file. It makes more sense to bundle multiple changes to sonic-types.yang together to avoid revision churn. This should be done as general cleanup prior to new release and should not be included in the scope of this PR. |
||
} | ||
} | ||
} | ||
/* end of VLAN_INTERFACE_LIST */ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests for MPLS CRM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kperumalbfn I looked at the existing CRM tests in sonic-yang-models. It appears that there exist currently generic parameter checking that is applicable for all CRM types. I don't think there needs to be anything specific for MPLS, since it can already make use of the generic CRM tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kperumalbfn I have added CRM tests for the 2 MPLS CRM types as requested.