diff options
Diffstat (limited to 'l3/impl/src/test/java/io/fd/hc2vpp/l3/read')
-rw-r--r-- | l3/impl/src/test/java/io/fd/hc2vpp/l3/read/InterfaceChildNodeTest.java | 27 | ||||
-rw-r--r-- | l3/impl/src/test/java/io/fd/hc2vpp/l3/read/ipv6/nd/NdProxyCustomizerTest.java | 10 |
2 files changed, 31 insertions, 6 deletions
diff --git a/l3/impl/src/test/java/io/fd/hc2vpp/l3/read/InterfaceChildNodeTest.java b/l3/impl/src/test/java/io/fd/hc2vpp/l3/read/InterfaceChildNodeTest.java index 48a1b7327..9534ac966 100644 --- a/l3/impl/src/test/java/io/fd/hc2vpp/l3/read/InterfaceChildNodeTest.java +++ b/l3/impl/src/test/java/io/fd/hc2vpp/l3/read/InterfaceChildNodeTest.java @@ -31,6 +31,13 @@ import io.fd.vpp.jvpp.core.dto.IpNeighborDetails; import io.fd.vpp.jvpp.core.dto.IpNeighborDetailsReplyDump; import io.fd.vpp.jvpp.core.dto.IpNeighborDump; import io.fd.vpp.jvpp.core.future.FutureJVppCore; +import io.fd.vpp.jvpp.core.types.Address; +import io.fd.vpp.jvpp.core.types.AddressFamily; +import io.fd.vpp.jvpp.core.types.AddressUnion; +import io.fd.vpp.jvpp.core.types.Ip4Address; +import io.fd.vpp.jvpp.core.types.Ip6Address; +import io.fd.vpp.jvpp.core.types.IpNeighbor; +import io.fd.vpp.jvpp.core.types.MacAddress; import java.util.Arrays; import java.util.List; import javax.annotation.Nonnull; @@ -185,9 +192,23 @@ public interface InterfaceChildNodeTest extends NamingContextHelper, FutureProdu static IpNeighborDetails neighborDump(byte[] address, int isIpv6, byte[] mac) { IpNeighborDetails detail = new IpNeighborDetails(); - detail.ipAddress = address; - detail.isIpv6 = (byte) isIpv6; - detail.macAddress = mac; + detail.neighbor = new IpNeighbor(); + detail.neighbor.ipAddress = new Address(); + AddressUnion addressUnion; + if (isIpv6 == 1) { + Ip6Address ip6Address = new Ip6Address(); + ip6Address.ip6Address = address; + addressUnion =new AddressUnion(ip6Address); + detail.neighbor.ipAddress.af = AddressFamily.ADDRESS_IP6; + } else { + Ip4Address ip4Address = new Ip4Address(); + ip4Address.ip4Address = address; + addressUnion =new AddressUnion(ip4Address); + detail.neighbor.ipAddress.af = AddressFamily.ADDRESS_IP4; + } + detail.neighbor.ipAddress.un = addressUnion; + detail.neighbor.macAddress = new MacAddress(); + detail.neighbor.macAddress.macaddress = mac; return detail; } diff --git a/l3/impl/src/test/java/io/fd/hc2vpp/l3/read/ipv6/nd/NdProxyCustomizerTest.java b/l3/impl/src/test/java/io/fd/hc2vpp/l3/read/ipv6/nd/NdProxyCustomizerTest.java index bc4cab554..a29250783 100644 --- a/l3/impl/src/test/java/io/fd/hc2vpp/l3/read/ipv6/nd/NdProxyCustomizerTest.java +++ b/l3/impl/src/test/java/io/fd/hc2vpp/l3/read/ipv6/nd/NdProxyCustomizerTest.java @@ -29,6 +29,7 @@ import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; import io.fd.vpp.jvpp.core.dto.Ip6NdProxyDetails; import io.fd.vpp.jvpp.core.dto.Ip6NdProxyDetailsReplyDump; +import io.fd.vpp.jvpp.core.types.Ip6Address; import java.util.List; import org.junit.Test; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.nd.proxy.rev170315.NdProxyIp6StateAugmentation; @@ -63,13 +64,16 @@ public class NdProxyCustomizerTest extends InitializingListReaderCustomizerTest< final Ip6NdProxyDetailsReplyDump reply = new Ip6NdProxyDetailsReplyDump(); final Ip6NdProxyDetails proxy1 = new Ip6NdProxyDetails(); proxy1.swIfIndex = IF1_INDEX; - proxy1.address = new byte[] {0x20, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01}; + proxy1.ip = new Ip6Address(); + proxy1.ip.ip6Address = new byte[] {0x20, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x01}; final Ip6NdProxyDetails proxy2 = new Ip6NdProxyDetails(); proxy2.swIfIndex = IF1_INDEX; - proxy2.address = new byte[] {0x20, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x02}; + proxy2.ip = new Ip6Address(); + proxy2.ip.ip6Address = new byte[] {0x20, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x02}; final Ip6NdProxyDetails proxy3 = new Ip6NdProxyDetails(); proxy3.swIfIndex = IF2_INDEX; - proxy3.address = new byte[] {0x20, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x03}; + proxy3.ip = new Ip6Address(); + proxy3.ip.ip6Address = new byte[] {0x20, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x03}; reply.ip6NdProxyDetails.add(proxy1); reply.ip6NdProxyDetails.add(proxy2); reply.ip6NdProxyDetails.add(proxy3); |