use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer in project bgpcep by opendaylight.
the class ExportDefaultStatementTest method testFromExternalToInternal.
@Test
public void testFromExternalToInternal() {
final Statement statement = getStatementAndSetToRole("from-external-to-internal", PeerRole.Ibgp);
final RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(createClusterInput());
assertApplyExportStatement(statement, PeerRole.Ebgp, attributeContainer, attributeContainer.getAttributes());
}
use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer in project bgpcep by opendaylight.
the class ExportDefaultStatementTest method assertApplyExportStatement.
private void assertApplyExportStatement(final Statement statement, final PeerRole fromPeerRole, final RouteAttributeContainer attInput, final Attributes attExpected) {
doReturn(fromPeerRole).when(this.exportParameters).getFromPeerRole();
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attInput, statement);
assertEquals(attExpected, result.getAttributes());
}
use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer in project bgpcep by opendaylight.
the class ExportDefaultStatementTest method testFromRRclientToInternal.
@Test
public void testFromRRclientToInternal() {
final Statement statement = getStatementAndSetToRole("from-rr-client-to-internal", PeerRole.Ibgp);
final RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(createClusterInput());
assertApplyExportStatement(statement, PeerRole.RrClient, attributeContainer, createInputWithOriginator());
}
use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer in project bgpcep by opendaylight.
the class ImportDefaultStatementTest method testFromNonExternal.
@Test
public void testFromNonExternal() {
final Statement statement = getStatement("from-non-external");
final Attributes expected = ImportAttributeTestUtil.createInput();
final RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(expected);
assertApplyImportStatement(statement, PeerRole.Ibgp, attributeContainer, expected);
assertApplyImportStatement(statement, PeerRole.RrClient, attributeContainer, expected);
assertApplyImportStatement(statement, PeerRole.Internal, attributeContainer, expected);
}
use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer in project bgpcep by opendaylight.
the class MatchAsPathSetTest method testMatchAsPathInverse.
@Test
public void testMatchAsPathInverse() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("reject-match-as-path-inverse-set")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setAsPath(new AsPathBuilder().setSegments(Collections.singletonList(new SegmentsBuilder().setAsSequence(Collections.singletonList(AsNumber.getDefaultInstance("65"))).build())).build()).build());
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertNotNull(result.getAttributes());
attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setAsPath(new AsPathBuilder().setSegments(Collections.singletonList(new SegmentsBuilder().setAsSequence(Collections.singletonList(AsNumber.getDefaultInstance("200"))).build())).build()).build());
result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertNull(result.getAttributes());
}
Aggregations