use of org.onosproject.mapping.addresses.IPMappingAddress in project onos by opennetworkinglab.
the class MappingEntryBuilderTest method testIpv6AddressConversion.
@Test
public void testIpv6AddressConversion() {
IPMappingAddress address = (IPMappingAddress) getMappingAddressByAfiType(IP6, UNKNOWN);
assertThat(address.ip(), is(IPV6_MAPPING_ADDRESS));
}
use of org.onosproject.mapping.addresses.IPMappingAddress in project onos by opennetworkinglab.
the class MappingEntryBuilderTest method testIpv4AddressConversion.
@Test
public void testIpv4AddressConversion() {
IPMappingAddress address = (IPMappingAddress) getMappingAddressByAfiType(IP4, UNKNOWN);
assertThat(address.ip(), is(IPV4_MAPPING_ADDRESS_1));
}
use of org.onosproject.mapping.addresses.IPMappingAddress in project onos by opennetworkinglab.
the class MappingEntryBuilderTest method testMapRecordConversion.
private void testMapRecordConversion(LispMapRecord record) {
MappingEntry mappingEntry = new MappingEntryBuilder(DEVICE_ID, record).build();
MappingKey key = mappingEntry.key();
MappingValue value = mappingEntry.value();
IPMappingAddress recordAddress = (IPMappingAddress) key.address();
assertThat(recordAddress.ip(), is(IpPrefix.valueOf(IP_RECORD_ADDRESS + "/" + IP_RECORD_MASK_LENGTH)));
assertThat(value.action().type(), is(MappingAction.Type.NATIVE_FORWARD));
assertThat(value.treatments().size(), is(1));
MappingTreatment treatment = value.treatments().get(0);
IPMappingAddress locatorAddress = (IPMappingAddress) treatment.address();
assertThat(locatorAddress.ip(), is(IpPrefix.valueOf(IPV4_ADDRESS_1 + "/" + IP_LOCATOR_MASK_LENGTH)));
}
Aggregations