Search in sources :

Example 6 with RouteAttributeContainer

use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer in project bgpcep by opendaylight.

the class ExportDefaultStatementTest method testFromInternalToInternal.

@Test
public void testFromInternalToInternal() {
    final Statement statement = getStatementAndSetToRole("from-internal-to-internal", PeerRole.Ibgp);
    final RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(createClusterInput());
    assertApplyExportStatement(statement, PeerRole.Ibgp, attributeContainer, null);
}
Also used : Statement(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.routing.policy.top.routing.policy.policy.definitions.policy.definition.statements.Statement) RouteAttributeContainer(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer) Test(org.junit.Test)

Example 7 with RouteAttributeContainer

use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer in project bgpcep by opendaylight.

the class ExportDefaultStatementTest method testFromExternalToRRClient.

@Test
public void testFromExternalToRRClient() {
    final Statement statement = getStatementAndSetToRole("from-external-to-route-reflector", PeerRole.RrClient);
    final RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(createClusterInput());
    assertApplyExportStatement(statement, PeerRole.Ebgp, attributeContainer, attributeContainer.getAttributes());
}
Also used : Statement(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.routing.policy.top.routing.policy.policy.definitions.policy.definition.statements.Statement) RouteAttributeContainer(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer) Test(org.junit.Test)

Example 8 with RouteAttributeContainer

use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer in project bgpcep by opendaylight.

the class ExportDefaultStatementTest method testOdlInternal.

@Test
public void testOdlInternal() {
    final Statement statement = getStatementAndSetToRole("to-odl-internal", PeerRole.Internal);
    final RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(createClusterInput());
    assertApplyExportStatement(statement, PeerRole.Ebgp, attributeContainer, null);
    assertApplyExportStatement(statement, PeerRole.Ibgp, attributeContainer, null);
    assertApplyExportStatement(statement, PeerRole.Internal, attributeContainer, null);
    assertApplyExportStatement(statement, PeerRole.RrClient, attributeContainer, null);
}
Also used : Statement(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.routing.policy.top.routing.policy.policy.definitions.policy.definition.statements.Statement) RouteAttributeContainer(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer) Test(org.junit.Test)

Example 9 with RouteAttributeContainer

use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer in project bgpcep by opendaylight.

the class ExportDefaultStatementTest method testToEbgp.

@Test
public void testToEbgp() {
    final Statement statement = getStatementAndSetToRole("to-external", PeerRole.Ebgp);
    final Attributes expectedOutput = createPathInputWithAs();
    final RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(createPathInput(null));
    assertApplyExportStatement(statement, PeerRole.Ebgp, attributeContainer, expectedOutput);
    assertApplyExportStatement(statement, PeerRole.Ibgp, attributeContainer, expectedOutput);
    assertApplyExportStatement(statement, PeerRole.Internal, attributeContainer, expectedOutput);
    assertApplyExportStatement(statement, PeerRole.RrClient, attributeContainer, expectedOutput);
}
Also used : Statement(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.routing.policy.top.routing.policy.policy.definitions.policy.definition.statements.Statement) Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes) RouteAttributeContainer(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer) Test(org.junit.Test)

Example 10 with RouteAttributeContainer

use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer in project bgpcep by opendaylight.

the class ImportDefaultStatementTest method assertApplyImportStatement.

private void assertApplyImportStatement(final Statement statement, final PeerRole fromPeerRole, final RouteAttributeContainer attInput, final Attributes attExpected) {
    doReturn(fromPeerRole).when(this.importParameters).getFromPeerRole();
    RouteAttributeContainer result = this.statementRegistry.applyImportStatement(this.baseAttributes, this.importParameters, attInput, statement);
    assertEquals(attExpected, result.getAttributes());
}
Also used : RouteAttributeContainer(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer)

Aggregations

RouteAttributeContainer (org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer)46 Test (org.junit.Test)44 Statement (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.routing.policy.top.routing.policy.policy.definitions.policy.definition.statements.Statement)44 AttributesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.AttributesBuilder)29 AsPathBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.AsPathBuilder)6 SegmentsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.as.path.SegmentsBuilder)6 Attributes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes)4 PeerId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerId)4 CommunitiesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.CommunitiesBuilder)3 ExtendedCommunitiesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.ExtendedCommunitiesBuilder)3 As4SpecificCommonBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.as._4.spec.common.As4SpecificCommonBuilder)3 As4RouteOriginExtendedCommunityCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.extended.community.extended.community.As4RouteOriginExtendedCommunityCaseBuilder)3 As4RouteOriginExtendedCommunityBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.extended.community.extended.community.as._4.route.origin.extended.community._case.As4RouteOriginExtendedCommunityBuilder)3 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)2 LocalPrefBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.LocalPrefBuilder)2 MultiExitDiscBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.MultiExitDiscBuilder)2 OriginBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.OriginBuilder)2 Ipv4NextHopCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv4NextHopCaseBuilder)2 Ipv4NextHopBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder)2 Ipv6Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)1