From b6ead1d5525b5b1500729959acbce905bbcbf04a Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Tue, 3 Jul 2018 12:44:55 +0200 Subject: HC2VPP-275: use ip-address-no-zone in v3po YANG model The inet:ip-address type was used in HC models due to ODL bug: https://bugs.opendaylight.org/show_bug.cgi?id=6413 which was fixed long time ago... Change-Id: Icaa8ac1269c730243afba53bc663f39f7c90f36c Signed-off-by: Marek Gradzki --- .../io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java | 12 ++++++------ .../io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java | 12 ++++++------ .../fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java | 12 ++++++------ .../fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java | 12 ++++++------ .../hc2vpp/v3po/interfacesstate/VxlanCustomizerTest.java | 12 ++++++------ .../v3po/interfacesstate/VxlanGpeCustomizerTest.java | 12 ++++++------ .../v3po/l2/ArpTerminationTableEntryCustomizerTest.java | 14 +++++++------- 7 files changed, 43 insertions(+), 43 deletions(-) (limited to 'v3po/v3po2vpp/src/test/java') diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java index 824f32392..68f266d52 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java @@ -36,8 +36,8 @@ import io.fd.vpp.jvpp.core.dto.GreAddDelTunnel; import io.fd.vpp.jvpp.core.dto.GreAddDelTunnelReply; import org.junit.Test; import org.mockito.ArgumentCaptor; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey; @@ -59,8 +59,8 @@ public class GreCustomizerTest extends WriterCustomizerTest { private static Gre generateGre() { final GreBuilder builder = new GreBuilder(); - builder.setSrc(new IpAddress(new Ipv4Address("192.168.20.10"))); - builder.setDst(new IpAddress(new Ipv4Address("192.168.20.11"))); + builder.setSrc(new IpAddressNoZone(new Ipv4AddressNoZone("192.168.20.10"))); + builder.setDst(new IpAddressNoZone(new Ipv4AddressNoZone("192.168.20.11"))); builder.setOuterFibId(Long.valueOf(123)); return builder.build(); } @@ -87,9 +87,9 @@ public class GreCustomizerTest extends WriterCustomizerTest { verify(api).greAddDelTunnel(argumentCaptor.capture()); final GreAddDelTunnel actual = argumentCaptor.getValue(); assertEquals(0, actual.isIpv6); - assertArrayEquals(InetAddresses.forString(gre.getSrc().getIpv4Address().getValue()).getAddress(), + assertArrayEquals(InetAddresses.forString(gre.getSrc().getIpv4AddressNoZone().getValue()).getAddress(), actual.srcAddress); - assertArrayEquals(InetAddresses.forString(gre.getDst().getIpv4Address().getValue()).getAddress(), + assertArrayEquals(InetAddresses.forString(gre.getDst().getIpv4AddressNoZone().getValue()).getAddress(), actual.dstAddress); assertEquals(gre.getOuterFibId().intValue(), actual.outerFibId); return actual; diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java index 404f25e02..5e758c4d4 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java @@ -39,8 +39,8 @@ import io.fd.vpp.jvpp.core.dto.VxlanAddDelTunnelReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey; @@ -66,8 +66,8 @@ public class VxlanCustomizerTest extends WriterCustomizerTest { private static Vxlan generateVxlan(long vni) { final VxlanBuilder builder = new VxlanBuilder(); - builder.setSrc(new IpAddress(new Ipv4Address("192.168.20.10"))); - builder.setDst(new IpAddress(new Ipv4Address("192.168.20.11"))); + builder.setSrc(new IpAddressNoZone(new Ipv4AddressNoZone("192.168.20.10"))); + builder.setDst(new IpAddressNoZone(new Ipv4AddressNoZone("192.168.20.11"))); builder.setEncapVrfId(new VniReference(123L)); builder.setVni(new VxlanVni(Long.valueOf(vni))); builder.setDecapNext(L2Input.class); @@ -105,9 +105,9 @@ public class VxlanCustomizerTest extends WriterCustomizerTest { final VxlanAddDelTunnel actual = argumentCaptor.getValue(); assertEquals(0, actual.isIpv6); assertEquals(1, actual.decapNextIndex); - assertArrayEquals(InetAddresses.forString(vxlan.getSrc().getIpv4Address().getValue()).getAddress(), + assertArrayEquals(InetAddresses.forString(vxlan.getSrc().getIpv4AddressNoZone().getValue()).getAddress(), actual.srcAddress); - assertArrayEquals(InetAddresses.forString(vxlan.getDst().getIpv4Address().getValue()).getAddress(), + assertArrayEquals(InetAddresses.forString(vxlan.getDst().getIpv4AddressNoZone().getValue()).getAddress(), actual.dstAddress); assertEquals(vxlan.getEncapVrfId().getValue().intValue(), actual.encapVrfId); assertEquals(vxlan.getVni().getValue().intValue(), actual.vni); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java index bca838f2e..7d282c09c 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java @@ -38,8 +38,8 @@ import io.fd.vpp.jvpp.core.dto.VxlanGpeAddDelTunnelReply; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey; @@ -64,8 +64,8 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest { private static VxlanGpe generateVxlanGpe(long vni) { final VxlanGpeBuilder builder = new VxlanGpeBuilder(); - builder.setLocal(new IpAddress(new Ipv4Address("192.168.20.10"))); - builder.setRemote(new IpAddress(new Ipv4Address("192.168.20.11"))); + builder.setLocal(new IpAddressNoZone(new Ipv4AddressNoZone("192.168.20.10"))); + builder.setRemote(new IpAddressNoZone(new Ipv4AddressNoZone("192.168.20.11"))); builder.setVni(new VxlanGpeVni(Long.valueOf(vni))); builder.setNextProtocol(VxlanGpeNextProtocol.forValue(1)); builder.setEncapVrfId(Long.valueOf(123)); @@ -104,9 +104,9 @@ public class VxlanGpeCustomizerTest extends WriterCustomizerTest { verify(api).vxlanGpeAddDelTunnel(argumentCaptor.capture()); final VxlanGpeAddDelTunnel actual = argumentCaptor.getValue(); assertEquals(0, actual.isIpv6); - assertArrayEquals(InetAddresses.forString(vxlanGpe.getLocal().getIpv4Address().getValue()).getAddress(), + assertArrayEquals(InetAddresses.forString(vxlanGpe.getLocal().getIpv4AddressNoZone().getValue()).getAddress(), actual.local); - assertArrayEquals(InetAddresses.forString(vxlanGpe.getRemote().getIpv4Address().getValue()).getAddress(), + assertArrayEquals(InetAddresses.forString(vxlanGpe.getRemote().getIpv4AddressNoZone().getValue()).getAddress(), actual.remote); assertEquals(vxlanGpe.getVni().getValue().intValue(), actual.vni); assertEquals(vxlanGpe.getNextProtocol().getIntValue(), actual.protocol); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java index 266e0c6af..686126247 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java @@ -95,13 +95,13 @@ public class GreCustomizerTest extends ReaderCustomizerTest { assertEquals(55, builder.getOuterFibId().intValue()); - assertNull(builder.getSrc().getIpv6Address()); - assertNotNull(builder.getSrc().getIpv4Address()); - assertEquals("1.2.3.5", builder.getSrc().getIpv4Address().getValue()); + assertNull(builder.getSrc().getIpv6AddressNoZone()); + assertNotNull(builder.getSrc().getIpv4AddressNoZone()); + assertEquals("1.2.3.5", builder.getSrc().getIpv4AddressNoZone().getValue()); - assertNull(builder.getDst().getIpv6Address()); - assertNotNull(builder.getDst().getIpv4Address()); - assertEquals("1.2.3.4", builder.getDst().getIpv4Address().getValue()); + assertNull(builder.getDst().getIpv6AddressNoZone()); + assertNotNull(builder.getDst().getIpv4AddressNoZone()); + assertEquals("1.2.3.4", builder.getDst().getIpv4AddressNoZone().getValue()); verify(api).greTunnelDump(any(GreTunnelDump.class)); } diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizerTest.java index 273fa3298..6ce09132b 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizerTest.java @@ -88,13 +88,13 @@ public class VxlanCustomizerTest extends ReaderCustomizerTest id; - private static InstanceIdentifier getArpEntryId(final IpAddress ipAddress, + private static InstanceIdentifier getArpEntryId(final IpAddressNoZone ipAddress, final PhysAddress physAddress) { return InstanceIdentifier.create(BridgeDomains.class).child(BridgeDomain.class, new BridgeDomainKey(BD_NAME)) .child(ArpTerminationTable.class) @@ -82,8 +82,8 @@ public class ArpTerminationTableEntryCustomizerTest extends WriterCustomizerTest physAddressRaw = new byte[]{1, 2, 3, 4, 5, 6}; physAddress = new PhysAddress("01:02:03:04:05:06"); - ipAddress = new IpAddress(Ipv4AddressNoZone.getDefaultInstance("1.2.3.4")); - ip6Address = new IpAddress(Ipv6AddressNoZone.getDefaultInstance("2001:0db8:0a0b:12f0:0000:0000:0000:0001")); + ipAddress = new IpAddressNoZone(Ipv4AddressNoZone.getDefaultInstance("1.2.3.4")); + ip6Address = new IpAddressNoZone(Ipv6AddressNoZone.getDefaultInstance("2001:0db8:0a0b:12f0:0000:0000:0000:0001")); entry = generateArpEntry(ipAddress, physAddress); ip6entry = generateArpEntry(ip6Address, physAddress); id = getArpEntryId(ipAddress, physAddress); @@ -110,7 +110,7 @@ public class ArpTerminationTableEntryCustomizerTest extends WriterCustomizerTest return request; } - private ArpTerminationTableEntry generateArpEntry(final IpAddress ipAddress, final PhysAddress physAddress) { + private ArpTerminationTableEntry generateArpEntry(final IpAddressNoZone ipAddress, final PhysAddress physAddress) { final ArpTerminationTableEntryBuilder entry = new ArpTerminationTableEntryBuilder(); entry.setKey(new ArpTerminationTableEntryKey(ipAddress, physAddress)); entry.setPhysAddress(physAddress); -- cgit 1.2.3-korg