use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method test21SBnegativeToSBmoreSpecific.
/*
* Mapping change: adding a more specific southbound mapping overlapping a less specific negative mapping
* Support status: SUPPORTED
* Description: When a more specific SB mapping is added, the subscribers of the overlapping less specific existing
* negative SB mapping are notified, the negative is deleted, and then more specific negatives are
* created when requested.
*/
private void test21SBnegativeToSBmoreSpecific() {
cleanUP();
allowNullAuthenticationForAllIPv4(1L);
// First we add two negative mappings to NB with a hole between them
insertNBMappings(1L, "192.167.0.0/16", "192.169.0.0/16");
// We query for the hole, adding a negative SB mapping for 192.168.0.0/16 with a subscriber in the process
MapReply mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
Eid expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/16");
MappingRecord mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedNegativePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isNegativeMapping(mr));
// Add the more specific new overlapping SB mapping
registerSBMapping(1L, "192.168.254.0/24", "10.10.10.10");
// Notification is sent for the original prefix
MappingServiceIntegrationTestUtil.checkSmr(socket, lms, mapService, 1L, "192.168.0.0");
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/17");
mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedNegativePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isNegativeMapping(mr));
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.254.1/32"));
Eid 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.mapping.record.container.MappingRecord in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method test18SBnegativeToNBmoreSpecific.
/*
* Mapping change: adding a more specific northbound mapping overlapping a less specific negative southbound mapping
* Support status: SUPPORTED
* Description: When a more specific NB mapping is added, the overlapping negative prefix is deleted, its
* subscribers notified, and then more specific negatives are created when requested.
*/
private void test18SBnegativeToNBmoreSpecific() {
cleanUP();
// First we add two negative mappings to NB with a hole between them
insertNBMappings(1L, "192.167.0.0/16", "192.169.0.0/16");
// We query for the hole, adding a negative SB mapping for 192.168.0.0/16 with a subscriber in the process
MapReply mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
Eid expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/16");
MappingRecord mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedNegativePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isNegativeMapping(mr));
// Add the more specific new overlapping NB mapping
insertNBMappings(1L, "192.168.1.0/24");
// Notification is sent for the original prefix
MappingServiceIntegrationTestUtil.checkSmr(socket, lms, mapService, 1L, "192.168.0.0");
// The original negative should now be broken up
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/24");
mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedNegativePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isNegativeMapping(mr));
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.64.1/32"));
expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.64.0/18");
mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedNegativePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isNegativeMapping(mr));
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.1.1/32"));
Eid expectedPositivePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.1.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.mapping.record.container.MappingRecord in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method testPositivePrefixOverlappingNegativePrefix_lessSpecific.
private void testPositivePrefixOverlappingNegativePrefix_lessSpecific() {
cleanUP();
insertNBMappings(1L, "192.167.0.0/16", "192.169.0.0/16");
MapReply mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
Eid expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/16");
MappingRecord mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedNegativePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isNegativeMapping(mr));
insertNBMappings(1L, "192.0.0.0/8");
MappingServiceIntegrationTestUtil.checkSmr(socket, lms, mapService, 1L, "192.168.0.0");
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
Eid expectedPositivePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.0.0.0/8");
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.mapping.record.container.MappingRecord in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTest method testPositiveMappingRemoval.
private void testPositiveMappingRemoval() {
cleanUP();
allowNullAuthenticationForAllIPv4(1L);
insertNBMappings(1L, "192.167.0.0/16", "192.169.0.0/16");
insertSBMappings(false, 1L, "192.168.32.0/19");
MapReply mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.0.1/32"));
Eid expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/19");
MappingRecord mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedNegativePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isNegativeMapping(mr));
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.64.1/32"));
expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.64.0/18");
mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedNegativePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isNegativeMapping(mr));
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.128.1/32"));
expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.128.0/17");
mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedNegativePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isNegativeMapping(mr));
MappingServiceIntegrationTestUtil.printMapCacheState(mapService);
mapService.removeMapping(MappingOrigin.Southbound, LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.32.0/19"));
MappingServiceIntegrationTestUtil.printMapCacheState(mapService);
mapReply = lms.handleMapRequest(newMapRequest(1L, "192.168.32.1/32"));
expectedNegativePrefix = LispAddressUtil.asIpv4PrefixBinaryEid(1L, "192.168.0.0/16");
mr = mapReply.getMappingRecordItem().get(0).getMappingRecord();
assertEquals(expectedNegativePrefix, mr.getEid());
assertTrue(MappingRecordUtil.isNegativeMapping(mr));
MappingServiceIntegrationTestUtil.printMapCacheState(mapService);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord in project lispflowmapping by opendaylight.
the class MultiSiteScenario method verifyMappingRecord.
private MappingRecord verifyMappingRecord(MapReply mapReply) {
assertNotNull(mapReply);
final List<MappingRecordItem> mappingRecordItems = mapReply.getMappingRecordItem();
assertNotNull(mappingRecordItems);
assertEquals(1, mappingRecordItems.size());
final MappingRecordItem mappingRecordItem = mappingRecordItems.get(0);
assertNotNull(mappingRecordItem);
final MappingRecord mappingRecord = mappingRecordItem.getMappingRecord();
assertNotNull(mappingRecord);
return mappingRecord;
}
Aggregations