Add to Gribi Get() tests validation that the correct status is returned#255
Open
gggsmith wants to merge 1 commit into
Open
Add to Gribi Get() tests validation that the correct status is returned#255gggsmith wants to merge 1 commit into
gggsmith wants to merge 1 commit into
Conversation
PiperOrigin-RevId: 721346682
Member
|
@gggsmith Happy to take a look at this PR -- can we make the build check pass? Thanks, |
robshakir
reviewed
Mar 26, 2025
Comment on lines
+389
to
+392
| if ipv4, ok := ni.ipv4[v.Ipv4.GetPrefix()]; !ok { | ||
| t.Fatalf("did not find entry, did not find ipv4: %s, got: %s\n", v.Ipv4, getres) | ||
| } else { | ||
| programmedStatusMatch(t, ipv4, wantProto) |
Member
There was a problem hiding this comment.
Suggested change
| if ipv4, ok := ni.ipv4[v.Ipv4.GetPrefix()]; !ok { | |
| t.Fatalf("did not find entry, did not find ipv4: %s, got: %s\n", v.Ipv4, getres) | |
| } else { | |
| programmedStatusMatch(t, ipv4, wantProto) | |
| ipv4, ok := ni.ipv4[v.Ipv4.GetPrefix()] | |
| if !ok { | |
| t.Fatalf("did not find entry, did not find ipv4: %s, got: %s\n", v.Ipv4, getres) | |
| } | |
| programmedStatusMatch(t, ipv4, wantProto) |
Member
There was a problem hiding this comment.
Suggest this layout here and above to avoid the indentation of the other case -- since the !ok case will exit via Fatalf we don't really need the else.
| WithIndex(1). | ||
| WithIPAddress("192.0.2.3")) | ||
| WithIPAddress("192.0.2.3"). | ||
| WithFIBProgrammed(wantACK)) |
Member
There was a problem hiding this comment.
This will lead -- in some cases -- to having WithFIBProgrammed(RIB_PROGRAMMED) which seems erroneous right? i.e., we will never have a fib_status field return RIB_PROGRAMMED right?
Instead, should we either have WithProgrammedStatus() which could take arguments of FIB ACKed or RIB ACKed? Or alternatively, WithFIBProgrammedStatus which only allows for FIB ACK or failed?
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 test verifies for Gribi
Modifycall that after receivingFIB_ACKprogramming status, GribiGetcalls returnFIB_PROGRAMMEDstatus for programmed entries. This is part of Gribi specification https://github.com/openconfig/gribi/blob/master/doc/specification.md#4133-life-cycle-of-an-aft-operation