Check device support for bgp.remove_private_as values#3463
Merged
Conversation
The 'check_device_attribute_support' function has been enhanced to check for the values of an enabled feature when that feature flag is a dictionary with 'valid' attribute. All other behavior is unchanged. This addition is used to check for valid values of the bgp.remove_private_as attribute on common platforms (EOS, FRR, IOS, IOS XR, Junos). Other changes: * Enhanced IOS XR support * The attribute value must be set in bgp.session plugin before the device support is checked (to give that function a value to check) Incidentally fixes #3165
There was a problem hiding this comment.
Pull request overview
This PR extends BGP device capability checks so platforms can declare supported values (not just on/off support) for specific BGP neighbor attributes, and uses that mechanism to validate per-platform values for bgp.remove_private_as (fixing #3165).
Changes:
- Enhanced
check_device_attribute_support()to validate neighbor attribute values when the device feature flag is a dict containing avalidlist. - Updated
bgp.sessionto set the neighbor attribute value before running device-support checks (so value validation has input). - Added/updated platform support for
remove_private_asvalues (notably IOS XR) and introduced an errors test to verify failures on unsupported values.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/errors/bgp-remove-private-as.yml | New error-topology test covering device-specific remove_private_as value validation |
| tests/errors/bgp-remove-private-as.log | Expected error output for unsupported remove_private_as values |
| netsim/utils/routing.py | Enhanced device attribute support check to validate dict-based valid values |
| netsim/extra/bgp.session/plugin.py | Ensures neighbor attribute is set before capability/value check |
| netsim/extra/bgp.session/iosxr.j2 | Expanded IOS XR rendering for various remove-private-AS modes |
| netsim/devices/xr.yml | Declares IOS XR-supported remove_private_as values via .valid |
| netsim/devices/junos.yml | Declares Junos-supported remove_private_as values via .valid |
| netsim/devices/ios.yml | Declares IOS-supported remove_private_as values via .valid |
| netsim/devices/frr.yml | Declares FRR-supported remove_private_as values via .valid |
| netsim/devices/eos.yml | Declares EOS-supported remove_private_as values via .valid |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The 'check_device_attribute_support' function has been enhanced to check for the values of an enabled feature when that feature flag is a dictionary with 'valid' attribute. All other behavior is unchanged.
This addition is used to check for valid values of the bgp.remove_private_as attribute on common platforms (EOS, FRR, IOS, IOS XR, Junos).
Other changes:
Incidentally fixes #3165