-
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
Junos: fix name-server #8839
Junos: fix name-server #8839
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8839 +/- ##
=======================================
Coverage 72.39% 72.39%
=======================================
Files 3295 3295
Lines 168869 168869
Branches 19804 19804
=======================================
+ Hits 122259 122261 +2
- Misses 37499 37502 +3
+ Partials 9111 9106 -5
|
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, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @zergling-aws)
projects/batfish/src/main/antlr4/org/batfish/grammar/flatjuniper/FlatJuniper_system.g4
line 64 at r1 (raw file):
sy_name_server : NAME_SERVER server = ip_address
We learned via investigation that source-address ip_address
is actually still valid, just optional.
To support that in ANTLR4, you would do (SOURCE_ADDRESS src = ip_address)?
Please update the test file with a new line that includes a new name-server and source-address, then check that both different name-servers are extracted.
Previously, dhalperi (Dan Halperin) wrote…
IIUC, the changed line would be: |
Previously, zergling-aws wrote…
weird escaping, but otherwise yes |
Previously, dhalperi (Dan Halperin) wrote…
Build fails with an error
That's due to the change I earlier made here. It looks like when the optional source IP address is present, I need to create the hostname like in the original code. How do I detect this condition to handle it differently? |
Previously, zergling-aws wrote…
I checked out your branch and made the described change and it compiles fine:
|
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 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @zergling-aws)
projects/batfish/src/test/java/org/batfish/grammar/flatjuniper/FlatJuniperGrammarTest.java
line 2728 at r2 (raw file):
Configuration config = parseConfig("name-server"); assertEquals(config.getDnsServers().toArray()[0], "1.2.3.4"); assertEquals(config.getDnsServers().toArray()[1], "2.0.0.0");
Use assertThat
still. You can either use contains(1.2.3.4, 2.0.0.0)
or containsInAnyOrder(1.2.3.4, 2.0.0.0)
-- the latter if the order is not guaranteed.
Code quote:
assertEquals(config.getDnsServers().toArray()[0], "1.2.3.4");
assertEquals(config.getDnsServers().toArray()[1], "2.0.0.0");
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 1 of 1 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @zergling-aws)
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 3 of 3 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @zergling-aws)
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 1 of 1 files at r5, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @zergling-aws)
Parsing Junos config
set system name-server <ip>
fails. This allows it.