Search in sources :

Example 31 with Batfish

use of org.batfish.main.Batfish in project batfish by batfish.

the class ElasticsearchDomainTest method loadAwsConfigurations.

public Map<String, Configuration> loadAwsConfigurations() throws IOException {
    List<String> awsFilenames = ImmutableList.of("ElasticsearchDomains.json", "SecurityGroups.json", "Subnets.json", "Vpcs.json", "NetworkAcls.json", "NetworkInterfaces.json", "Reservations.json");
    Batfish batfish = BatfishTestUtils.getBatfishFromTestrigText(TestrigText.builder().setAwsText("org/batfish/representation/aws/test", awsFilenames).build(), _folder);
    return batfish.loadConfigurations();
}
Also used : Batfish(org.batfish.main.Batfish)

Example 32 with Batfish

use of org.batfish.main.Batfish in project batfish by batfish.

the class BatfishCompressionTest method getDataPlane.

private DataPlane getDataPlane(SortedMap<String, Configuration> configs) throws IOException {
    // make sure to reconstruct the network, since compression mutates it
    TemporaryFolder tmp = new TemporaryFolder();
    tmp.create();
    Batfish batfish = BatfishTestUtils.getBatfish(configs, tmp);
    BdpDataPlanePlugin bdpDataPlanePlugin = new BdpDataPlanePlugin();
    bdpDataPlanePlugin.initialize(batfish);
    batfish.registerDataPlanePlugin(bdpDataPlanePlugin, "bdp");
    batfish.computeDataPlane(false);
    return batfish.loadDataPlane();
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder) BdpDataPlanePlugin(org.batfish.bdp.BdpDataPlanePlugin) Batfish(org.batfish.main.Batfish) IBatfish(org.batfish.common.plugin.IBatfish)

Aggregations

Batfish (org.batfish.main.Batfish)32 Test (org.junit.Test)25 Configuration (org.batfish.datamodel.Configuration)20 Prefix (org.batfish.datamodel.Prefix)10 SortedMap (java.util.SortedMap)9 AbstractRoute (org.batfish.datamodel.AbstractRoute)8 Matchers.containsString (org.hamcrest.Matchers.containsString)8 SortedSet (java.util.SortedSet)7 Interface (org.batfish.datamodel.Interface)7 Ip (org.batfish.datamodel.Ip)7 TemporaryFolder (org.junit.rules.TemporaryFolder)7 Set (java.util.Set)6 MultipathEquivalentAsPathMatchMode (org.batfish.datamodel.MultipathEquivalentAsPathMatchMode)6 ImmutableSortedMap (com.google.common.collect.ImmutableSortedMap)5 InterfaceAddress (org.batfish.datamodel.InterfaceAddress)5 Vrf (org.batfish.datamodel.Vrf)5 ImmutableList (com.google.common.collect.ImmutableList)4 IOException (java.io.IOException)4 Collection (java.util.Collection)4 List (java.util.List)4