summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/test
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-07-03 12:44:55 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-07-04 10:57:08 +0000
commitb6ead1d5525b5b1500729959acbce905bbcbf04a (patch)
treec951b431c5d2ddaf4f6965e54560645b3dd6d63d /v3po/v3po2vpp/src/test
parent0461747b7d4e2c395a04501cddfa492c4f75ef7c (diff)
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 <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test')
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/GreCustomizerTest.java12
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanCustomizerTest.java12
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/VxlanGpeCustomizerTest.java12
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/GreCustomizerTest.java12
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanCustomizerTest.java12
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizerTest.java12
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizerTest.java14
7 files changed, 43 insertions, 43 deletions
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<Gre, GreBuilder> {
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<Vxlan, VxlanBuilde
assertEquals(55, builder.getEncapVrfId().getValue().intValue());
assertEquals(L2Input.class, builder.getDecapNext());
- 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).vxlanTunnelDump(any(VxlanTunnelDump.class));
}
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizerTest.java
index 7b1881bf9..319ef93e1 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/VxlanGpeCustomizerTest.java
@@ -96,13 +96,13 @@ public class VxlanGpeCustomizerTest extends ReaderCustomizerTest<VxlanGpe, Vxlan
final VxlanGpeBuilder builder = getCustomizer().getBuilder(VXLAN_GPE_ID);
getCustomizer().readCurrentAttributes(VXLAN_GPE_ID, builder, ctx);
- assertNull(builder.getLocal().getIpv6Address());
- assertNotNull(builder.getLocal().getIpv4Address());
- assertEquals("1.2.3.4", builder.getLocal().getIpv4Address().getValue());
+ assertNull(builder.getLocal().getIpv6AddressNoZone());
+ assertNotNull(builder.getLocal().getIpv4AddressNoZone());
+ assertEquals("1.2.3.4", builder.getLocal().getIpv4AddressNoZone().getValue());
- assertNull(builder.getRemote().getIpv6Address());
- assertNotNull(builder.getRemote().getIpv4Address());
- assertEquals("1.2.3.5", builder.getRemote().getIpv4Address().getValue());
+ assertNull(builder.getRemote().getIpv6AddressNoZone());
+ assertNotNull(builder.getRemote().getIpv4AddressNoZone());
+ assertEquals("1.2.3.5", builder.getRemote().getIpv4AddressNoZone().getValue());
assertEquals(9, builder.getVni().getValue().intValue());
assertEquals(1, builder.getNextProtocol().getIntValue());
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizerTest.java
index 091b2422c..b785142b0 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/ArpTerminationTableEntryCustomizerTest.java
@@ -34,7 +34,7 @@ import io.fd.vpp.jvpp.core.dto.BdIpMacAddDel;
import io.fd.vpp.jvpp.core.dto.BdIpMacAddDelReply;
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.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.inet.types.rev130715.Ipv6AddressNoZone;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress;
@@ -60,13 +60,13 @@ public class ArpTerminationTableEntryCustomizerTest extends WriterCustomizerTest
private byte[] ip6AddressRaw;
private byte[] physAddressRaw;
private PhysAddress physAddress;
- private IpAddress ipAddress;
- private IpAddress ip6Address;
+ private IpAddressNoZone ipAddress;
+ private IpAddressNoZone ip6Address;
private ArpTerminationTableEntry entry;
private ArpTerminationTableEntry ip6entry;
private InstanceIdentifier<ArpTerminationTableEntry> id;
- private static InstanceIdentifier<ArpTerminationTableEntry> getArpEntryId(final IpAddress ipAddress,
+ private static InstanceIdentifier<ArpTerminationTableEntry> 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);