use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open in project bgpcep by opendaylight.
the class FSMTest method sameBGPIDs.
@Test
public void sameBGPIDs() {
this.clientSession.channelActive(null);
assertEquals(1, this.receivedMsgs.size());
assertTrue(this.receivedMsgs.get(0) instanceof Open);
this.clientSession.handleMessage(new OpenBuilder(this.classicOpen).setBgpIdentifier(new Ipv4AddressNoZone("1.1.1.1")).build());
assertEquals(2, this.receivedMsgs.size());
assertTrue(this.receivedMsgs.get(1) instanceof Notify);
final Notification m = this.receivedMsgs.get(this.receivedMsgs.size() - 1);
assertEquals(BGPError.BAD_BGP_ID, BGPError.forValue(((Notify) m).getErrorCode(), ((Notify) m).getErrorSubcode()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open in project bgpcep by opendaylight.
the class FSMTest method testBgpExtendedMessageCapability.
@Test
public void testBgpExtendedMessageCapability() {
this.clientSession.channelActive(null);
assertEquals(1, this.receivedMsgs.size());
assertTrue(this.receivedMsgs.get(0) instanceof Open);
final List<BgpParameters> tlvs = new ArrayList<>();
final List<OptionalCapabilities> capas = new ArrayList<>();
capas.add(new OptionalCapabilitiesBuilder().setCParameters(new CParametersBuilder().addAugmentation(new CParameters1Builder().setMultiprotocolCapability(new MultiprotocolCapabilityBuilder().setAfi(this.ipv4tt.getAfi()).setSafi(this.ipv4tt.getSafi()).build()).build()).build()).build());
capas.add(new OptionalCapabilitiesBuilder().setCParameters(new CParametersBuilder().setAs4BytesCapability(new As4BytesCapabilityBuilder().setAsNumber(new AsNumber(Uint32.valueOf(30))).build()).build()).build());
tlvs.add(new BgpParametersBuilder().setOptionalCapabilities(capas).build());
this.clientSession.handleMessage(new OpenBuilder().setMyAsNumber(Uint16.valueOf(30)).setHoldTimer(Uint16.ONE).setVersion(new ProtocolVersion(Uint8.valueOf(4))).setBgpParameters(tlvs).setBgpIdentifier(new Ipv4AddressNoZone("1.1.1.2")).build());
assertEquals(2, this.receivedMsgs.size());
assertTrue(this.receivedMsgs.get(1) instanceof Keepalive);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open in project bgpcep by opendaylight.
the class AbstractAddPathTest method causeBGPError.
void causeBGPError(final BGPSessionImpl session) {
final Open openObj = new OpenBuilder().setBgpIdentifier(new Ipv4AddressNoZone("1.1.1.1")).setHoldTimer(Uint16.valueOf(50)).setMyAsNumber(Uint16.valueOf(72)).build();
waitFutureSuccess(session.writeAndFlush(openObj));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open in project bgpcep by opendaylight.
the class GracefulRestartTest method resetConnectionOnOpenTest.
/**
* Test correct behavior when connection restart is unnoticed.
* "Correct" means that the previous TCP session MUST be closed, and the new one retained.
* Since the previous connection is considered to be terminated, no NOTIFICATION message should be sent.
*/
@Test
public void resetConnectionOnOpenTest() {
checkReceivedMessages(this.listener, 2);
final Open open = createClassicOpen(true);
this.session.writeAndFlush(open);
checkIdleState(this.peer);
checkReceivedMessages(this.listener, 2);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open in project bgpcep by opendaylight.
the class APITest method testBgpExtendedMessageUtil.
@Test
public void testBgpExtendedMessageUtil() {
final List<BgpParameters> params = new ArrayList<>();
final List<OptionalCapabilities> capas = new ArrayList<>();
capas.add(new OptionalCapabilitiesBuilder().setCParameters(new CParametersBuilder().addAugmentation(new CParameters1Builder().setMultiprotocolCapability(new MultiprotocolCapabilityBuilder().build()).build()).build()).build());
capas.add(new OptionalCapabilitiesBuilder().setCParameters(BgpExtendedMessageUtil.EXTENDED_MESSAGE_CAPABILITY).build());
params.add(new BgpParametersBuilder().setOptionalCapabilities(capas).build());
final Open open1 = new OpenBuilder().setBgpParameters(params).build();
assertTrue(BgpExtendedMessageUtil.advertizedBgpExtendedMessageCapability(open1));
}
Aggregations