use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method testRecievingNonProxyOnXtrPort.
public void testRecievingNonProxyOnXtrPort() throws SocketTimeoutException, SocketException, Throwable {
cleanUP();
configLispPlugin.shouldListenOnXtrPort(true);
notificationCalled = false;
final String eid = "10.10.10.10/32";
String rloc = "127.0.0.3";
int port = LispMessage.XTR_PORT_NUM;
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(ApplicationDataLcaf.class);
rb.setVirtualNetworkId(null);
rb.setAddress(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ApplicationDataBuilder().setApplicationData(new ApplicationDataBuilder().setAddress(new SimpleAddress(new IpAddress(new Ipv4Address(rloc)))).setLocalPortLow(new PortNumber(port)).build()).build());
Rloc adLcaf = rb.build();
final MapRequest mapRequest = createNonProxyMapRequest(eid, adLcaf);
((LispMappingService) lms).getNotificationService().registerNotificationListener(new XtrRequestMappingListener() {
@Override
public void onXtrRequestMapping(XtrRequestMapping notification) {
assertEquals(((Ipv4Prefix) mapRequest.getEidItem().get(0).getEid().getAddress()).getIpv4Prefix().getValue(), eid);
notificationCalled = true;
LOG.warn("notification arrived");
}
});
sendMapRequest(mapRequest, port);
for (int i = 0; i < MAX_NOTIFICATION_RETRYS; i++) {
if (notificationCalled) {
return;
} else {
LOG.warn("notification hasn't arrived, sleeping...");
Thread.sleep(500);
}
}
fail("Notification hasn't arrived");
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method testNonProxyOtherPort.
public void testNonProxyOtherPort() throws SocketTimeoutException, SocketException {
cleanUP();
String rloc = "127.0.0.3";
int port = 4350;
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(ApplicationDataLcaf.class);
rb.setVirtualNetworkId(null);
rb.setAddress(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ApplicationDataBuilder().setApplicationData(new ApplicationDataBuilder().setAddress(new SimpleAddress(new IpAddress(new Ipv4Address(rloc)))).setLocalPortLow(new PortNumber(port)).build()).build());
Rloc adLcaf = rb.build();
LOG.info("testNonProxyOtherPort:" + LispAddressStringifier.getString(adLcaf));
sendProxyMapRequest(rloc, port, adLcaf);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getTransportAddressFromRlocTest_withIpv6Address.
/**
* Tests {@link LispNotificationHelper#getTransportAddressFromRloc} method with Ipv6 type address.
*/
@Test
public void getTransportAddressFromRlocTest_withIpv6Address() {
final TransportAddress result = new TransportAddressBuilder().setIpAddress(new IpAddressBinary(ADDRESS_IPV6_BINARY)).setPort(new PortNumber(LispMessage.PORT_NUM)).build();
assertEquals(result, LispNotificationHelper.getTransportAddressFromRloc(RLOC_IPV6));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getTransportAddressFromRlocTest_withIpv6AddressBinary.
/**
* Tests {@link LispNotificationHelper#getTransportAddressFromRloc} method with Ipv6AddressBinary type address.
*/
@Test
public void getTransportAddressFromRlocTest_withIpv6AddressBinary() {
final TransportAddress result = new TransportAddressBuilder().setIpAddress(new IpAddressBinary(ADDRESS_IPV6_BINARY)).setPort(new PortNumber(LispMessage.PORT_NUM)).build();
assertEquals(result, LispNotificationHelper.getTransportAddressFromRloc(RLOC_IPV6_BINARY));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getTransportAddressFromRlocTest_withApplicationDataIpv6Address.
/**
* Tests {@link LispNotificationHelper#getTransportAddressFromRloc} method with ApplicationData type Ipv6 address.
*/
@Test
public void getTransportAddressFromRlocTest_withApplicationDataIpv6Address() {
final TransportAddress result = new TransportAddressBuilder().setIpAddress(new IpAddressBinary(ADDRESS_IPV6_BINARY)).setPort(new PortNumber(PORT)).build();
assertEquals(result, LispNotificationHelper.getTransportAddressFromRloc(RLOC_APPLICATION_DATA_IPV6));
}
Aggregations