-
Notifications
You must be signed in to change notification settings - Fork 197
Added additional( route update check) atomic changes #4968
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
base: main
Are you sure you want to change the base?
Added additional( route update check) atomic changes #4968
Conversation
Summary of ChangesHello @paramasivamn1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the testing framework for AFT atomic flag checks and streamlines BGP configuration logic. It modifies the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Pull Request Functional Test Report for #4968 / d1fe492Virtual Devices
Hardware Devices
|
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.
Code Review
This pull request refactors the atomic AFT test by changing how test cases are structured and verified. It also includes some refactoring in the BGP configuration plugin. My review has identified a critical issue in internal/cfgplugins/bgp.go where a function signature change leads to a compilation error in a case that was not updated. I've also pointed out some minor issues like commented-out code that should be removed and a typo in a comment. Please address the critical issue to ensure the code compiles and functions as expected.
internal/cfgplugins/bgp.go
Outdated
| // at the afisafi level is supported or not. It updates the sb with the necessary | ||
| // configuration. | ||
| func handleMultipathDeviation(t *testing.T, dut *ondatra.DUTDevice, sb *gnmi.SetBatch, cfg BGPNeighborsConfig) error { | ||
| func handleMultipathDeviation(t *testing.T, dut *ondatra.DUTDevice, root *oc.Root, cfg BGPNeighborsConfig) error { |
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.
Changing the function signature to remove sb *gnmi.SetBatch introduces a compilation error. The case ondatra.JUNIPER: block within this function (on line 706) still attempts to use sb in a gnmi.BatchUpdate call, but sb is now undefined in this scope. To fix this, you should remove the gnmi.BatchUpdate call from the JUNIPER case, similar to how it was removed from the general case. The caller, CreateBGPNeighbors, is already responsible for batching the updates to the root object.
| // oneLinkDownBGP := aftcache.InitialSyncStoppingCondition(t, dut, bgpPrefixes, ipv4OneNH, ipv6OneNH) | ||
| // if dut.Vendor() == ondatra.CISCO { | ||
| // ipv6OneNH = map[string]bool{"fe80::200:2ff:fe02:202": true} | ||
| // oneLinkDownBGP = aftcache.InitialSyncStoppingCondition(t, dut, bgpPrefixes, ipv4OneNH, ipv6OneNH) | ||
| // } |
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.
internal/cfgplugins/bgp.go
Outdated
| } | ||
|
|
||
| // handleMultipathDeviation implements the deviation logic whether multipath config | ||
| f// handleMultipathDeviation implements the deviation logic whether multipath config |
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.
Pull Request Test Coverage Report for Build 20772734558Details
💛 - Coveralls |
updating the isissession typo.
typo
| dutPort1 := dut.Port(t, port1Name).Name() | ||
| dutIntf1 := dutP1.NewOCInterface(dutPort1, dut) | ||
| gnmi.Replace(t, dut, gnmi.OC().Interface(dutPort1).Config(), dutIntf1) | ||
| p1 := dut.Port(t, port1Name).Name() | ||
| i1 := dutP1.NewOCInterface(p1, dut) | ||
| gnmi.Update(t, dut, gnmi.OC().Interface(p1).Config(), i1) |
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.
Some of these changes don't seem totally necessary? Seems like it was just copied from another test? Can we not make these naming changes? (The new names are less descriptive, anyway.)
|
|
||
| if err := handleMultipathDeviation(t, dut, sb, cfg); err != nil { | ||
| return err | ||
| // Configure MaximumPaths | ||
| if deviations.EnableMultipathUnderAfiSafi(dut) { | ||
| global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST).GetOrCreateUseMultiplePaths().GetOrCreateEbgp().MaximumPaths = ygot.Uint32(2) | ||
| global.GetOrCreateAfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV6_UNICAST).GetOrCreateUseMultiplePaths().GetOrCreateEbgp().MaximumPaths = ygot.Uint32(2) | ||
| } else { | ||
| if err := handleMultipathDeviation(t, dut, sb, cfg); err != nil { | ||
| return err | ||
| } | ||
| } |
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.
Can you not do this inline? Break it out into a function similar to how it was before and condition on the vendor(s) you expect to be present.
Added additional( route update check) atomic changes