-
Notifications
You must be signed in to change notification settings - Fork 229
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
BGP: ensure local-pref clips when adding or subtracting #6639
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6639 +/- ##
=========================================
Coverage 73.45% 73.45%
- Complexity 36458 36459 +1
=========================================
Files 2917 2917
Lines 146884 146880 -4
Branches 17706 17709 +3
=========================================
Hits 107888 107888
+ Misses 30493 30486 -7
- Partials 8503 8506 +3 |
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.
Reviewed 5 of 5 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dhalperi)
projects/batfish-common-protocol/src/test/java/org/batfish/datamodel/routing_policy/expr/DecrementLocalPreferenceTest.java, line 34 at r1 (raw file):
Bgpv4Route testRoute = Bgpv4Route.testBuilder().setNetwork(Prefix.ZERO).setLocalPreference(0L).build(); DecrementLocalPreference add5 = new DecrementLocalPreference(5);
add5
is an unusual name for this object
projects/batfish-common-protocol/src/test/java/org/batfish/datamodel/routing_policy/expr/DecrementLocalPreferenceTest.java, line 37 at r1 (raw file):
// Clips 0 to 0 assertThat( add5.evaluate(Environment.builder(c).setOriginalRoute(testRoute).build()), equalTo(0L));
if i'm being really nitpicky, i'd say you should test this with a route that has local preference 2 or something, so we can see it clips to 0 rather than has no effect. (same thought with the clip test for IncrementLocalPreference.) nbd though.
projects/batfish-common-protocol/src/test/java/org/batfish/datamodel/routing_policy/expr/DecrementLocalPreferenceTest.java, line 50 at r1 (raw file):
.setOriginalRoute(testRoute.toBuilder().setLocalPreference(105).build()) .build()), equalTo(100L));
why bother having both of these (10 and 105)?
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.
Reviewed 2 of 2 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved
No description provided.