use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testPimSMTree.
@Test
public void testPimSMTree() throws Exception {
final Attributes attributes = buildPimSMTreeAttribute();
final ByteBuf actual = Unpooled.buffer();
this.handler.serializeAttribute(attributes, actual);
assertArrayEquals(PIM_SM_TREE_EXPECTED, ByteArray.readAllBytes(actual));
final Attributes expected = buildPimSMTreeAttribute();
final Attributes actualAttr = this.handler.parseAttributes(Unpooled.wrappedBuffer(PIM_SM_TREE_EXPECTED), null);
assertEquals(expected, actualAttr);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTestUtil method buildIngressReplicationAttribute.
static Attributes buildIngressReplicationAttribute() {
final PmsiTunnelBuilder pmsiTunnelBuilder = getPmsiTunnelBuilder();
pmsiTunnelBuilder.setTunnelIdentifier(new IngressReplicationBuilder().setIngressReplication(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.ingress.replication.IngressReplicationBuilder().setReceivingEndpointAddress(IP_ADDRESS).build()).build());
return buildAttribute(pmsiTunnelBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTestUtil method buildMLDpMp2mPLspAttribute.
static Attributes buildMLDpMp2mPLspAttribute() {
final PmsiTunnelBuilder pmsiTunnelBuilder = getPmsiTunnelBuilder();
pmsiTunnelBuilder.setTunnelIdentifier(new MldpMp2mpLspBuilder().setMldpMp2mpLsp(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.mldp.mp2mp.lsp.MldpMp2mpLspBuilder().setOpaque(OPAQUE_TEST).setOpaqueType(OpaqueUtil.GENERIC_LSP_IDENTIFIER).build()).build());
return buildAttribute(pmsiTunnelBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTestUtil method buildMldpp2MPLspL2vpnAttribute.
static Attributes buildMldpp2MPLspL2vpnAttribute() {
final PmsiTunnelBuilder pmsiTunnelBuilder = getPmsiTunnelBuilder();
pmsiTunnelBuilder.setTunnelIdentifier(buildMldpP2mpLsp(IP_ADDRESS, L2vpnAddressFamily.class, createOpaqueList()));
return buildAttribute(pmsiTunnelBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes in project bgpcep by opendaylight.
the class BGPParserTest method testGetUpdateMessage5.
/*
* Tests withdrawn routes.
*
* ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff <- marker
* 00 1c <- length (28) - including header
* 02 <- message type
* 00 05 <- withdrawn routes length (5)
* 1e ac 10 00 04 <- route (172.16.0.4)
* 00 00 <- total path attribute length
*/
@Test
public void testGetUpdateMessage5() throws Exception {
final byte[] body = ByteArray.cutBytes(inputBytes.get(4), MessageUtil.COMMON_HEADER_LENGTH);
final int messageLength = ByteArray.bytesToInt(ByteArray.subByte(inputBytes.get(4), MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
final Update message = BGPParserTest.updateParser.parseMessageBody(Unpooled.copiedBuffer(body), messageLength);
// attributes
final List<WithdrawnRoutes> withdrawnRoutes = Lists.newArrayList(new WithdrawnRoutesBuilder().setPrefix(new Ipv4Prefix("172.16.0.4/30")).build());
// check API message
final Update expectedMessage = new UpdateBuilder().setWithdrawnRoutes(withdrawnRoutes).build();
assertEquals(expectedMessage.getWithdrawnRoutes(), message.getWithdrawnRoutes());
final ByteBuf buffer = Unpooled.buffer();
BGPParserTest.updateParser.serializeMessage(message, buffer);
assertArrayEquals(inputBytes.get(4), ByteArray.readAllBytes(buffer));
}
Aggregations