Search in sources :

Example 1 with IPMappingAddress

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));
}
Also used : IPMappingAddress(org.onosproject.mapping.addresses.IPMappingAddress) Test(org.junit.Test)

Example 2 with IPMappingAddress

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));
}
Also used : IPMappingAddress(org.onosproject.mapping.addresses.IPMappingAddress) Test(org.junit.Test)

Example 3 with IPMappingAddress

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)));
}
Also used : MappingEntry(org.onosproject.mapping.MappingEntry) IPMappingAddress(org.onosproject.mapping.addresses.IPMappingAddress) MappingKey(org.onosproject.mapping.MappingKey) MappingValue(org.onosproject.mapping.MappingValue) MappingTreatment(org.onosproject.mapping.MappingTreatment)

Aggregations

IPMappingAddress (org.onosproject.mapping.addresses.IPMappingAddress)3 Test (org.junit.Test)2 MappingEntry (org.onosproject.mapping.MappingEntry)1 MappingKey (org.onosproject.mapping.MappingKey)1 MappingTreatment (org.onosproject.mapping.MappingTreatment)1 MappingValue (org.onosproject.mapping.MappingValue)1