use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method registerAndQuery__SegmentLCAF.
public void registerAndQuery__SegmentLCAF() throws SocketTimeoutException {
cleanUP();
String ipString = "10.20.255.30";
int instanceId = 6;
EidBuilder eb = new EidBuilder();
eb.setAddressType(Ipv4PrefixAfi.class);
eb.setVirtualNetworkId(new InstanceIdType((long) instanceId));
eb.setAddress(new Ipv4PrefixBuilder().setIpv4Prefix(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix(ipString)).build());
MapReply reply = registerAddressAndQuery(eb.build());
Eid receivedAddress = reply.getMappingRecordItem().get(0).getMappingRecord().getEid();
assertEquals(Ipv4PrefixAfi.class, receivedAddress.getAddressType());
assertEquals(ipString, ((Ipv4Prefix) receivedAddress.getAddress()).getIpv4Prefix().getValue());
assertEquals(instanceId, receivedAddress.getVirtualNetworkId().getValue().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method queryForAddress.
private MapReply queryForAddress(Eid eid, String srcEid) throws SocketTimeoutException {
MapRequestBuilder mapRequestBuilder = new MapRequestBuilder();
mapRequestBuilder.setNonce((long) 4);
mapRequestBuilder.setEidItem(new ArrayList<EidItem>());
mapRequestBuilder.getEidItem().add(new EidItemBuilder().setEid(eid).build());
mapRequestBuilder.setItrRloc(new ArrayList<ItrRloc>());
if (srcEid != null) {
mapRequestBuilder.setSourceEid(new SourceEidBuilder().setEid(LispAddressUtil.asIpv4Eid(srcEid)).build());
} else {
mapRequestBuilder.setSourceEid(new SourceEidBuilder().setEid(LispAddressUtil.asIpv4Eid(ourAddress)).build());
}
mapRequestBuilder.getItrRloc().add(new ItrRlocBuilder().setRloc(LispAddressUtil.asIpv4Rloc(ourAddress)).build());
mapRequestBuilder.setAuthoritative(false);
mapRequestBuilder.setMapDataPresent(false);
mapRequestBuilder.setPitr(false);
mapRequestBuilder.setProbe(false);
mapRequestBuilder.setSmr(false);
mapRequestBuilder.setSmrInvoked(false);
sendMapRequest(mapRequestBuilder.build());
return receiveMapReply();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method test14SBpositiveToSBmoreSpecific.
/*
* Mapping change: adding a more specific southbound mapping overlapping a less specific one
* Support status: SUPPORTED
* Description: When a more specific SB mapping is added, the subscribers of the overlapping less specific existing
* SB mapping are notified.
*/
private void test14SBpositiveToSBmoreSpecific() {
cleanUP();
allowNullAuthenticationForAllIPv4(1L);
insertSBMappings(false, 1L, "192.168.0.0/16");
MapReply mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
Eid expectedPositivePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/16");
MappingRecord mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedPositivePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isPositiveMapping(mr));
registerSBMapping(1L, "192.168.254.0/24", "10.10.10.10");
MappingServiceIntegrationTestUtil.checkSmr(socket, lms, mapService, 1L, "192.168.0.0");
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
expectedPositivePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/16");
mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedPositivePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isPositiveMapping(mr));
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.254.1/32"));
expectedPositivePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.254.0/24");
mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedPositivePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isPositiveMapping(mr));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method registerAndQuery__ListLCAF.
public void registerAndQuery__ListLCAF() throws SocketTimeoutException {
cleanUP();
String macString = "01:02:03:04:05:06";
String ipString = "10.20.255.30";
List<SimpleAddress> addresses = new ArrayList<SimpleAddress>();
addresses.add(new SimpleAddress(new IpAddress(new Ipv4Address(ipString))));
addresses.add(new SimpleAddress(new MacAddress(macString)));
AfiListBuilder listbuilder = new AfiListBuilder();
listbuilder.setAddressList(addresses);
EidBuilder eb = new EidBuilder();
eb.setAddressType(AfiListLcaf.class);
eb.setVirtualNetworkId(null);
eb.setAddress(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.AfiListBuilder().setAfiList(listbuilder.build()).build());
MapReply reply = registerAddressAndQuery(eb.build());
Eid receivedAddress = reply.getMappingRecordItem().get(0).getMappingRecord().getEid();
assertEquals(AfiListLcaf.class, receivedAddress.getAddressType());
AfiList listAddrFromNetwork = (AfiList) receivedAddress.getAddress();
SimpleAddress receivedAddr1 = (SimpleAddress) listAddrFromNetwork.getAfiList().getAddressList().get(0);
SimpleAddress receivedAddr2 = (SimpleAddress) listAddrFromNetwork.getAfiList().getAddressList().get(1);
assertNotNull(receivedAddr1.getIpAddress().getIpv4Address());
assertNotNull(receivedAddr2.getMacAddress());
assertEquals(macString, receivedAddr2.getMacAddress().getValue());
assertEquals(ipString, receivedAddr1.getIpAddress().getIpv4Address().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method testNbSourceDest.
private void testNbSourceDest() {
cleanUP();
insertNBMappingSourceDest(1L, "192.0.2.0/24", "192.168.0.0/16", MappingServiceIntegrationTestUtil.DEFAULT_IPV4_RLOC_STRING);
MapReply mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
Eid expectedPositivePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/16");
MappingRecord mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedPositivePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isPositiveMapping(mr));
insertNBMapping(1L, "192.168.0.0/16", "10.10.10.10");
MappingServiceIntegrationTestUtil.checkSmr(socket, lms, mapService, 1L, "192.168.0.0");
}
Aggregations