@Test public void testCreateVxlanBridgeDomainOnVppNode() throws Exception { bridgeDomainManager.createVxlanBridgeDomainOnVppNode(BRIDGE_DOMAIN_ID, BRIDGE_DOMAIN_VNI, VPP_NODE_ID); Thread vbdThread = new Thread(() -> { WriteTransaction wTx = dataBroker.newWriteOnlyTransaction(); wTx.put(LogicalDatastoreType.OPERATIONAL, VppIidFactory .getNodeIid(BASE_TOPOLOGY.getKey(), new NodeKey(VPP_NODE_ID)), new NodeBuilder().setNodeId(VPP_NODE_ID) .addAugmentation(NodeVbridgeAugment.class, new NodeVbridgeAugmentBuilder() .setBridgeMember(new BridgeMemberBuilder().build()).build()) .build(), true); try { wTx.submit().get(); } catch (InterruptedException | ExecutionException e) { Assert.fail(); } }); vbdThread.join(); Optional<Topology> topologyOptional = DataStoreHelper.readFromDs(LogicalDatastoreType.CONFIGURATION, VppIidFactory.getTopologyIid(BASE_TOPOLOGY.getKey()), dataBroker.newReadOnlyTransaction()); Assert.assertTrue(topologyOptional.isPresent()); Topology topology = topologyOptional.get(); Assert.assertEquals(BASE_TOPOLOGY.getAugmentation(TopologyVbridgeAugment.class), topology.getAugmentation(TopologyVbridgeAugment.class)); }
@Override public ListenableFuture<Void> createVxlanBridgeDomainOnVppNode(@Nonnull final String bridgeDomainName, @Nonnull final VxlanVni vni, @Nonnull final NodeId vppNodeId) { TopologyVbridgeAugment topologyAug = new TopologyVbridgeAugmentBuilder().setTunnelType(TunnelTypeVxlan.class) .setArpTermination(false) .setFlood(true) .setForward(true) .setLearn(true) .setUnknownUnicastFlood(true) .setTunnelParameters(new VxlanTunnelParametersBuilder().setVni(vni).build()) .build(); return createBridgeDomainOnVppNode(bridgeDomainName, topologyAug, createBasicVppNodeBuilder(vppNodeId).build()); }
BridgeDomainManagerImpl implements BridgeDomainManager { @Override public ListenableFuture<Void> createVxlanBridgeDomainOnVppNode(@Nonnull final String bridgeDomainName, @Nonnull final VxlanVni vni, @Nonnull final NodeId vppNodeId) { TopologyVbridgeAugment topologyAug = new TopologyVbridgeAugmentBuilder().setTunnelType(TunnelTypeVxlan.class) .setArpTermination(false) .setFlood(true) .setForward(true) .setLearn(true) .setUnknownUnicastFlood(true) .setTunnelParameters(new VxlanTunnelParametersBuilder().setVni(vni).build()) .build(); return createBridgeDomainOnVppNode(bridgeDomainName, topologyAug, createBasicVppNodeBuilder(vppNodeId).build()); } }
BridgeDomainManagerImpl implements BridgeDomainManager { @Override public ListenableFuture<Void> createVxlanBridgeDomainOnVppNode(@Nonnull final String bridgeDomainName, @Nonnull final VxlanVni vni, @Nonnull final NodeId vppNodeId) { TopologyVbridgeAugment topologyAug = new TopologyVbridgeAugmentBuilder().setTunnelType(TunnelTypeVxlan.class) .setArpTermination(false) .setFlood(true) .setForward(true) .setLearn(true) .setUnknownUnicastFlood(true) .setTunnelParameters(new VxlanTunnelParametersBuilder().setVni(vni).build()) .build(); return createBridgeDomainOnVppNode(bridgeDomainName, topologyAug, createBasicVppNodeBuilder(vppNodeId).build()); } BridgeDomainManagerImpl(DataBroker dataProvider); }
BridgeDomainManagerImpl implements BridgeDomainManager { @Override public ListenableFuture<Void> createVxlanBridgeDomainOnVppNode(@Nonnull final String bridgeDomainName, @Nonnull final VxlanVni vni, @Nonnull final NodeId vppNodeId) { TopologyVbridgeAugment topologyAug = new TopologyVbridgeAugmentBuilder().setTunnelType(TunnelTypeVxlan.class) .setArpTermination(false) .setFlood(true) .setForward(true) .setLearn(true) .setUnknownUnicastFlood(true) .setTunnelParameters(new VxlanTunnelParametersBuilder().setVni(vni).build()) .build(); return createBridgeDomainOnVppNode(bridgeDomainName, topologyAug, createBasicVppNodeBuilder(vppNodeId).build()); } BridgeDomainManagerImpl(DataBroker dataProvider); @Override ListenableFuture<Void> createVxlanBridgeDomainOnVppNode(@Nonnull final String bridgeDomainName,
                                                                   @Nonnull final VxlanVni vni,
                                                                   @Nonnull final NodeId vppNodeId); @Override ListenableFuture<Void> createVlanBridgeDomainOnVppNode(@Nonnull final String bridgeDomainName,
                                                                  @Nonnull final VlanId vlanId,
                                                                  @Nonnull final NodeId vppNodeId); @Override ListenableFuture<Void> removeBridgeDomainFromVppNode(@Nonnull final String bridgeDomainName,
                                                                @Nonnull final NodeId vppNode); }
BridgeDomainManagerImpl implements BridgeDomainManager { @Override public ListenableFuture<Void> createVxlanBridgeDomainOnVppNode(@Nonnull final String bridgeDomainName, @Nonnull final VxlanVni vni, @Nonnull final NodeId vppNodeId) { TopologyVbridgeAugment topologyAug = new TopologyVbridgeAugmentBuilder().setTunnelType(TunnelTypeVxlan.class) .setArpTermination(false) .setFlood(true) .setForward(true) .setLearn(true) .setUnknownUnicastFlood(true) .setTunnelParameters(new VxlanTunnelParametersBuilder().setVni(vni).build()) .build(); return createBridgeDomainOnVppNode(bridgeDomainName, topologyAug, createBasicVppNodeBuilder(vppNodeId).build()); } BridgeDomainManagerImpl(DataBroker dataProvider); @Override ListenableFuture<Void> createVxlanBridgeDomainOnVppNode(@Nonnull final String bridgeDomainName,
                                                                   @Nonnull final VxlanVni vni,
                                                                   @Nonnull final NodeId vppNodeId); @Override ListenableFuture<Void> createVlanBridgeDomainOnVppNode(@Nonnull final String bridgeDomainName,
                                                                  @Nonnull final VlanId vlanId,
                                                                  @Nonnull final NodeId vppNodeId); @Override ListenableFuture<Void> removeBridgeDomainFromVppNode(@Nonnull final String bridgeDomainName,
                                                                @Nonnull final NodeId vppNode);  }