Skip to content

Commit

Permalink
Merge pull request #86 from batfish/unstable
Browse files Browse the repository at this point in the history
Unstable
  • Loading branch information
arifogel committed Mar 25, 2017
2 parents 0dfba8d + 89414d1 commit 2fb8a01
Show file tree
Hide file tree
Showing 21 changed files with 399 additions and 270 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public final class Version {

private static final String UNKNOWN_VERSION = "0.0.0";

private static final String VERSION = "0.11.0";
private static final String VERSION = "0.11.1";

public static void checkCompatibleVersion(String myName, String otherName,
String otherVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ public void setVariables(SortedMap<String, Variable> variables) {

private static final String DIFF_VAR = "differential";

public static final String INNER_QUESTION_VAR = "innerQuestion";

public static final String INSTANCE_VAR = "instance";

private boolean _differential;
Expand Down
12 changes: 12 additions & 0 deletions projects/batfish/src/org/batfish/main/Batfish.java
Original file line number Diff line number Diff line change
Expand Up @@ -2745,6 +2745,18 @@ private String preprocessQuestion(String rawQuestionText) {
JSONObject jobj = new JSONObject(rawQuestionText);
String questionText = rawQuestionText;
Set<String> varsToRemove = new HashSet<>();
// first preprocess inner questions
if (jobj.has(Question.INNER_QUESTION_VAR)) {
JSONObject innerQuestion = jobj
.getJSONObject(Question.INNER_QUESTION_VAR);
String innerQuestionStr = innerQuestion.toString();
String preprocessedInnerQuestionStr = preprocessQuestion(
innerQuestionStr);
JSONObject preprocessedInnerQuestion = new JSONObject(
preprocessedInnerQuestionStr);
jobj.put(Question.INNER_QUESTION_VAR, preprocessedInnerQuestion);
questionText = jobj.toString();
}
if (jobj.has(Question.INSTANCE_VAR)
&& !jobj.isNull(Question.INSTANCE_VAR)) {
JSONObject instanceDataObj = jobj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,6 @@ public void setResults(SortedMap<Integer, JsonPathDiffResult> results) {
*/
public static class JsonPathQuestion extends Question {

private static final String INNER_QUESTION_VAR = "innerQuestion";

private static final String PATHS_VAR = "paths";

private Question _innerQuestion;
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/dc-as-reuse.ref
Original file line number Diff line number Diff line change
Expand Up @@ -4680,7 +4680,7 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
Expand Down Expand Up @@ -4836,7 +4836,7 @@
}
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.InitInfoAnswerElement",
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/disable-as-suppression.ref
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,11 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.InitInfoAnswerElement",
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/example-isp-switchover-1.ref
Original file line number Diff line number Diff line change
Expand Up @@ -9740,7 +9740,7 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
Expand Down Expand Up @@ -9869,7 +9869,7 @@
}
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.InitInfoAnswerElement",
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/example-isp-switchover-2.ref
Original file line number Diff line number Diff line change
Expand Up @@ -9740,7 +9740,7 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
Expand Down Expand Up @@ -9869,7 +9869,7 @@
}
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.InitInfoAnswerElement",
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/example-juniper.ref
Original file line number Diff line number Diff line change
Expand Up @@ -10316,7 +10316,7 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
Expand Down Expand Up @@ -10445,7 +10445,7 @@
}
}
},
"version" : "0.11.0",
"version" : "0.11.1",
"warnings" : {
"as1border1" : {
"Red flags" : {
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/example-nsdi.ref
Original file line number Diff line number Diff line change
Expand Up @@ -2829,11 +2829,11 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.InitInfoAnswerElement",
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/example.ref
Original file line number Diff line number Diff line change
Expand Up @@ -10325,7 +10325,7 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
Expand Down Expand Up @@ -10468,7 +10468,7 @@
}
}
},
"version" : "0.11.0",
"version" : "0.11.1",
"warnings" : {
"as1border1" : {
"Red flags" : {
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/indirection.ref
Original file line number Diff line number Diff line change
Expand Up @@ -944,11 +944,11 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.InitInfoAnswerElement",
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/isis.ref
Original file line number Diff line number Diff line change
Expand Up @@ -2446,11 +2446,11 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.InitInfoAnswerElement",
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/policy-routing.ref
Original file line number Diff line number Diff line change
Expand Up @@ -1903,11 +1903,11 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.InitInfoAnswerElement",
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/srx-testbed.ref
Original file line number Diff line number Diff line change
Expand Up @@ -5909,7 +5909,7 @@
]
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
Expand All @@ -5927,7 +5927,7 @@
}
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.InitInfoAnswerElement",
Expand Down
4 changes: 2 additions & 2 deletions test_rigs/parsing-tests/unit-tests.ref
Original file line number Diff line number Diff line change
Expand Up @@ -25841,7 +25841,7 @@
]
}
},
"version" : "0.11.0",
"version" : "0.11.1",
"warnings" : {
"bgp_address_family" : {
"Red flags" : {
Expand Down Expand Up @@ -26601,7 +26601,7 @@
}
}
},
"version" : "0.11.0",
"version" : "0.11.1",
"warnings" : {
"address_family" : {
"Red flags" : {
Expand Down
4 changes: 2 additions & 2 deletions tests/java/init-dc-as-reuse.ref
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"pod_1_tor_0" : "PASSED",
"pod_1_tor_1" : "PASSED"
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
Expand Down Expand Up @@ -182,7 +182,7 @@
}
}
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.InitInfoAnswerElement",
Expand Down
4 changes: 2 additions & 2 deletions tests/java/init-delta.ref
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"testrig/iptables/host1.iptables" : "PASSED",
"testrig/iptables/host2.iptables" : "PASSED"
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
Expand Down Expand Up @@ -180,7 +180,7 @@
}
}
},
"version" : "0.11.0",
"version" : "0.11.1",
"warnings" : {
"as1border1" : {
"Red flags" : {
Expand Down
4 changes: 2 additions & 2 deletions tests/java/init-unit-tests.ref
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
"vrf_context" : "PASSED",
"vxlan" : "PASSED"
},
"version" : "0.11.0",
"version" : "0.11.1",
"warnings" : {
"bgp_address_family" : {
"Red flags" : {
Expand Down Expand Up @@ -1092,7 +1092,7 @@
}
}
},
"version" : "0.11.0",
"version" : "0.11.1",
"warnings" : {
"address_family" : {
"Red flags" : {
Expand Down
4 changes: 2 additions & 2 deletions tests/java/init.ref
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"testrig/iptables/host1.iptables" : "PASSED",
"testrig/iptables/host2.iptables" : "PASSED"
},
"version" : "0.11.0"
"version" : "0.11.1"
},
{
"class" : "org.batfish.datamodel.answers.ConvertConfigurationAnswerElement",
Expand Down Expand Up @@ -183,7 +183,7 @@
}
}
},
"version" : "0.11.0",
"version" : "0.11.1",
"warnings" : {
"as1border1" : {
"Red flags" : {
Expand Down

0 comments on commit 2fb8a01

Please sign in to comment.