use of org.batfish.datamodel.NetworkFactory in project batfish by batfish.
the class BdpDataPlanePluginTest method setup.
@Before
public void setup() {
_nf = new NetworkFactory();
_cb = _nf.configurationBuilder();
_ib = _nf.interfaceBuilder();
_nb = _nf.bgpNeighborBuilder();
_pb = _nf.bgpProcessBuilder();
_vb = _nf.vrfBuilder();
_epb = _nf.routingPolicyBuilder();
}
use of org.batfish.datamodel.NetworkFactory in project batfish by batfish.
the class OspfTest method setup.
@Before
public void setup() {
_nf = new NetworkFactory();
_cb = _nf.configurationBuilder().setConfigurationFormat(ConfigurationFormat.CISCO_IOS);
_vb = _nf.vrfBuilder().setName(Configuration.DEFAULT_VRF_NAME);
_ib = _nf.interfaceBuilder().setActive(true).setOspfCost(1).setOspfEnabled(true);
_opb = _nf.ospfProcessBuilder();
}
use of org.batfish.datamodel.NetworkFactory in project batfish by batfish.
the class SynthesizerInputImplTest method setup.
@Before
public void setup() {
_nf = new NetworkFactory();
_cb = _nf.configurationBuilder().setConfigurationFormat(ConfigurationFormat.CISCO_IOS);
_vb = _nf.vrfBuilder();
_ib = _nf.interfaceBuilder().setActive(true).setBandwidth(1E9d);
_aclb = _nf.aclBuilder();
_acllb = IpAccessListLine.builder();
_inputBuilder = SynthesizerInputImpl.builder();
_snb = SourceNat.builder();
}
use of org.batfish.datamodel.NetworkFactory in project batfish by batfish.
the class RoutingPolicyTests method initializeFactory.
@Before
public void initializeFactory() {
NetworkFactory nf = new NetworkFactory();
_c = nf.configurationBuilder().setConfigurationFormat(ConfigurationFormat.CISCO_IOS).build();
_rpb = nf.routingPolicyBuilder().setOwner(_c);
_w = new Warnings();
_w.setRedFlagRecord(true);
}
use of org.batfish.datamodel.NetworkFactory in project batfish by batfish.
the class BdpDataPlanePluginTest method testStaticInterfaceRoutesWithoutEdge.
@Test
public void testStaticInterfaceRoutesWithoutEdge() {
NetworkFactory nf = new NetworkFactory();
Configuration c = nf.configurationBuilder().setConfigurationFormat(ConfigurationFormat.CISCO_IOS).build();
Vrf vrf = nf.vrfBuilder().setOwner(c).setName(DEFAULT_VRF_NAME).build();
Interface i = nf.interfaceBuilder().setOwner(c).setVrf(vrf).setAddress(new InterfaceAddress("10.0.0.0/24")).setActive(true).build();
StaticRoute srBoth = StaticRoute.builder().setNetwork(Prefix.parse("10.0.1.0/24")).setNextHopInterface(i.getName()).setNextHopIp(new Ip("10.0.0.1")).build();
vrf.getStaticRoutes().add(srBoth);
StaticRoute srJustInterface = StaticRoute.builder().setNetwork(Prefix.parse("10.0.2.0/24")).setNextHopInterface(i.getName()).build();
vrf.getStaticRoutes().add(srJustInterface);
BdpEngine engine = new BdpEngine(new MockBdpSettings(), new BatfishLogger(BatfishLogger.LEVELSTR_DEBUG, false), (a, b) -> new AtomicInteger());
Topology topology = new Topology(Collections.emptySortedSet());
BdpDataPlane dp = engine.computeDataPlane(false, ImmutableMap.of(c.getName(), c), topology, Collections.emptySet(), new BdpAnswerElement());
// generating fibs should not crash
dp.getFibs();
}
Aggregations