-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Juniper: handle full range of local-pref values
1. Use uint32 to accurately parse the exact range. 2. They are longs, not ints. 3. Fix VI representation and other parsers.
- Loading branch information
Showing
14 changed files
with
81 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
15 changes: 15 additions & 0 deletions
15
...s/batfish/src/test/java/org/batfish/representation/juniper/PsFromLocalPreferenceTest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.batfish.representation.juniper; | ||
|
||
import com.google.common.testing.EqualsTester; | ||
import org.junit.Test; | ||
|
||
public class PsFromLocalPreferenceTest { | ||
@Test | ||
public void testEquals() { | ||
new EqualsTester() | ||
.addEqualityGroup(5) | ||
.addEqualityGroup(new PsFromLocalPreference(5), new PsFromLocalPreference(5)) | ||
.addEqualityGroup(new PsFromLocalPreference(6)) | ||
.testEquals(); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
.../src/test/resources/org/batfish/grammar/juniper/testconfigs/juniper-policy-statement-then
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# | ||
set system host-name juniper-policy-statement-then | ||
# | ||
set policy-options policy-statement LOCAL_PREFERENCE_POLICY term T1 then local-preference 1 | ||
set policy-options policy-statement LOCAL_PREFERENCE_POLICY term T2 then local-preference add 2 | ||
set policy-options policy-statement LOCAL_PREFERENCE_POLICY term T3 then local-preference subtract 3 | ||
set policy-options policy-statement LOCAL_PREFERENCE_POLICY term TSETMIN then local-preference 0 | ||
set policy-options policy-statement LOCAL_PREFERENCE_POLICY term TADDMAX then local-preference add 4294967295 | ||
set policy-options policy-statement LOCAL_PREFERENCE_POLICY term TSUB3 then local-preference subtract 3 | ||
# |
This file contains 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
This file contains 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