Search in sources :

Example 71 with Attributes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.

the class PMSITunnelAttributeHandlerTest method testMldpP2MpLsp.

@Test
public void testMldpP2MpLsp() throws Exception {
    final Attributes expectedIpv4Att = buildMldpP2mpLspIpv4Attribute();
    final ByteBuf actualIpv4 = Unpooled.buffer();
    this.handler.serializeAttribute(expectedIpv4Att, actualIpv4);
    assertArrayEquals(M_LDP_P2MP_LSP_EXPECTED_IPV4, ByteArray.readAllBytes(actualIpv4));
    final Attributes actualIpv4Attribute = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_P2MP_LSP_EXPECTED_IPV4_2), null).getAttributes();
    assertEquals(expectedIpv4Att, actualIpv4Attribute);
    final Attributes expectedIpv6Att = buildMldpP2mpLspIpv6Attribute();
    final ByteBuf actualIpv6 = Unpooled.buffer();
    this.handler.serializeAttribute(expectedIpv6Att, actualIpv6);
    assertArrayEquals(M_LDP_P2MP_LSP_EXPECTED_IPV6, ByteArray.readAllBytes(actualIpv6));
    final Attributes actualIpv6Attribute = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_P2MP_LSP_EXPECTED_IPV6), null).getAttributes();
    assertEquals(expectedIpv6Att, actualIpv6Attribute);
    final ByteBuf actualL2vpn = Unpooled.buffer();
    this.handler.serializeAttribute(buildNoSupportedFamilyAttribute(), actualL2vpn);
    assertArrayEquals(new byte[0], ByteArray.readAllBytes(actualIpv4));
    final Attributes actualWrongFamily = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_P2MP_LSP_EXPECTED_WRONG_FAMILY), null).getAttributes();
    assertEquals(buildWOTunnelInfAttribute(), actualWrongFamily);
    final Attributes expectedL2vpnAtt = buildMldpp2MPLspL2vpnAttribute();
    final Attributes actualL2vpnAttribute = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_P2MP_LSP_EXPECTED_L2VPN), null).getAttributes();
    assertEquals(expectedL2vpnAtt, actualL2vpnAttribute);
    final ByteBuf actualL2vp = Unpooled.buffer();
    this.handler.serializeAttribute(expectedL2vpnAtt, actualL2vp);
    assertArrayEquals(M_LDP_P2MP_LSP_EXPECTED_L2VPN, ByteArray.readAllBytes(actualL2vp));
    final ByteBuf actualNonSupportedOpaques = Unpooled.buffer();
    this.handler.serializeAttribute(buildNoSupportedOpaqueAttribute(), actualNonSupportedOpaques);
    assertArrayEquals(NO_TUNNEL_INFORMATION_PRESENT_EXPECTED, ByteArray.readAllBytes(actualNonSupportedOpaques));
}
Also used : Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 72 with Attributes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.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).getAttributes();
    assertEquals(expected, actualAttr);
}
Also used : Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 73 with Attributes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.

the class PMSITunnelAttributeHandlerTest method serializePimSSMTree.

@Test
public void serializePimSSMTree() {
    final Attributes attributes = buildPimSSMTreeAttribute();
    final ByteBuf actual = Unpooled.buffer();
    this.handler.serializeAttribute(attributes, actual);
    assertArrayEquals(PIM_SSM_TREE_EXPECTED, ByteArray.readAllBytes(actual));
}
Also used : Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Example 74 with Attributes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.

the class PMSITunnelAttributeHandlerTest method parsePimSSMTree.

@Test
public void parsePimSSMTree() throws Exception {
    final Attributes expected = buildPimSSMTreeAttribute();
    final Attributes actual = this.handler.parseAttributes(Unpooled.wrappedBuffer(PIM_SSM_TREE_EXPECTED), null).getAttributes();
    assertEquals(expected, actual);
}
Also used : Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes) Test(org.junit.Test)

Example 75 with Attributes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.

the class PMSITunnelAttributeHandlerTest method testIngressReplication.

@Test
public void testIngressReplication() throws Exception {
    final Attributes expected = buildIngressReplicationAttribute();
    final ByteBuf actual = Unpooled.buffer();
    this.handler.serializeAttribute(expected, actual);
    assertArrayEquals(INGRESS_REPLICATION_EXPECTED, ByteArray.readAllBytes(actual));
    final Attributes actualAttr = this.handler.parseAttributes(Unpooled.wrappedBuffer(INGRESS_REPLICATION_EXPECTED), null).getAttributes();
    assertEquals(expected, actualAttr);
}
Also used : Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)104 ByteBuf (io.netty.buffer.ByteBuf)82 Attributes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes)60 Attributes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes)47 Update (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.Update)47 AttributesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.AttributesBuilder)42 AbstractRIBSupportTest (org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest)38 AttributesReach (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.AttributesReach)35 AttributesUnreach (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.AttributesUnreach)35 ArrayList (java.util.ArrayList)31 MapEntryNode (org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode)14 Ipv4AddressNoZone (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone)13 UpdateBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.UpdateBuilder)13 Ipv4NextHopCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.next.hop.c.next.hop.Ipv4NextHopCaseBuilder)12 Ipv4NextHopBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder)12 PmsiTunnelBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev200120.pmsi.tunnel.PmsiTunnelBuilder)12 Collections (java.util.Collections)11 AsPathBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.attributes.AsPathBuilder)11 MpUnreachNlri (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.attributes.unreach.MpUnreachNlri)11 AsNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber)10