summaryrefslogtreecommitdiffstats
path: root/mpls/impl/src/test
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-03-12 08:50:58 +0100
committerMarek Gradzki <mgradzki@cisco.com>2018-03-12 09:17:33 +0100
commit30dd5a48584aed8b4edc528218d13b75edfc2b54 (patch)
treefac8bc0a1e3eb8c65a36c79d84dd4f8edce8c42f /mpls/impl/src/test
parent283915ef6f657a8b1fe7a72a6d39465f823033a0 (diff)
Adapt mpls plugin to recent VPP API changes
MPLS API changes were introduced by: https://gerrit.fd.io/r/#/c/10781/ Change-Id: I0423a4cfdf3f0654324118a1d34864a079bff5d1 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'mpls/impl/src/test')
-rw-r--r--mpls/impl/src/test/java/io/fd/hc2vpp/mpls/ImposeAndForwardTest.java8
-rw-r--r--mpls/impl/src/test/java/io/fd/hc2vpp/mpls/PopAndIpv4LookupTest.java3
-rw-r--r--mpls/impl/src/test/java/io/fd/hc2vpp/mpls/PopAndMplsLookupTest.java3
-rw-r--r--mpls/impl/src/test/java/io/fd/hc2vpp/mpls/SwapAndForwardTest.java6
4 files changed, 13 insertions, 7 deletions
diff --git a/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/ImposeAndForwardTest.java b/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/ImposeAndForwardTest.java
index c1ced8e1d..6eb559da8 100644
--- a/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/ImposeAndForwardTest.java
+++ b/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/ImposeAndForwardTest.java
@@ -23,11 +23,13 @@ import static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet
import io.fd.hc2vpp.common.test.write.WriterCustomizerTest;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
+import io.fd.hc2vpp.common.translate.util.MplsLabelTranslator;
import io.fd.hc2vpp.common.translate.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.vpp.jvpp.core.dto.IpAddDelRoute;
import io.fd.vpp.jvpp.core.dto.IpAddDelRouteReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCoreFacade;
+import io.fd.vpp.jvpp.core.types.FibMplsLabel;
import java.util.Arrays;
import java.util.Collections;
import org.junit.Test;
@@ -52,7 +54,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.routing.rev
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.routing.types.rev170227.MplsLabel;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-public class ImposeAndForwardTest extends WriterCustomizerTest implements ByteDataTranslator {
+public class ImposeAndForwardTest extends WriterCustomizerTest implements ByteDataTranslator, MplsLabelTranslator {
private static final String IF_NAME = "local0";
private static final int IF_INDEX = 123;
@@ -180,7 +182,7 @@ public class ImposeAndForwardTest extends WriterCustomizerTest implements ByteDa
request.nextHopAddress = nextHop;
request.nextHopNOutLabels = 1;
request.nextHopViaLabel = LspWriter.MPLS_LABEL_INVALID;
- request.nextHopOutLabelStack = new int[] {label};
+ request.nextHopOutLabelStack = new FibMplsLabel[] {translate(label)};
return request;
}
@@ -194,7 +196,7 @@ public class ImposeAndForwardTest extends WriterCustomizerTest implements ByteDa
request.nextHopAddress = new byte[] {10, 10, 12, 2};
request.nextHopNOutLabels = 2;
request.nextHopViaLabel = LspWriter.MPLS_LABEL_INVALID;
- request.nextHopOutLabelStack = new int[] {102, 104};
+ request.nextHopOutLabelStack = new FibMplsLabel[] {translate(102), translate(104)};
return request;
}
}
diff --git a/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/PopAndIpv4LookupTest.java b/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/PopAndIpv4LookupTest.java
index e924cfaaf..61e1c6d58 100644
--- a/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/PopAndIpv4LookupTest.java
+++ b/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/PopAndIpv4LookupTest.java
@@ -27,6 +27,7 @@ import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.vpp.jvpp.core.dto.MplsRouteAddDel;
import io.fd.vpp.jvpp.core.dto.MplsRouteAddDelReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCoreFacade;
+import io.fd.vpp.jvpp.core.types.FibMplsLabel;
import org.junit.Test;
import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.mpls._static.rev170310.Mpls1;
@@ -119,7 +120,7 @@ public class PopAndIpv4LookupTest extends WriterCustomizerTest implements ByteDa
request.mrNextHop = new byte[0]; // POP, so no next hop
request.mrNextHopSwIfIndex = -1; // this is what CLI is doing
request.mrNextHopViaLabel = LspWriter.MPLS_LABEL_INVALID; // default value used by make test
- request.mrNextHopOutLabelStack = new int[0];
+ request.mrNextHopOutLabelStack = new FibMplsLabel[0];
return request;
}
}
diff --git a/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/PopAndMplsLookupTest.java b/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/PopAndMplsLookupTest.java
index de32a1907..f5a76974a 100644
--- a/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/PopAndMplsLookupTest.java
+++ b/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/PopAndMplsLookupTest.java
@@ -27,6 +27,7 @@ import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.vpp.jvpp.core.dto.MplsRouteAddDel;
import io.fd.vpp.jvpp.core.dto.MplsRouteAddDelReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCoreFacade;
+import io.fd.vpp.jvpp.core.types.FibMplsLabel;
import org.junit.Test;
import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.mpls._static.rev170310.Mpls1;
@@ -119,7 +120,7 @@ public class PopAndMplsLookupTest extends WriterCustomizerTest implements ByteDa
request.mrNextHop = new byte[0]; // POP, so no next hop
request.mrNextHopSwIfIndex = -1; // this is what CLI is doing
request.mrNextHopViaLabel = LspWriter.MPLS_LABEL_INVALID; // default value used by make test
- request.mrNextHopOutLabelStack = new int[0];
+ request.mrNextHopOutLabelStack = new FibMplsLabel[0];
return request;
}
}
diff --git a/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/SwapAndForwardTest.java b/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/SwapAndForwardTest.java
index 6fd9e02f5..5b0e124f0 100644
--- a/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/SwapAndForwardTest.java
+++ b/mpls/impl/src/test/java/io/fd/hc2vpp/mpls/SwapAndForwardTest.java
@@ -22,11 +22,13 @@ import static org.mockito.Mockito.when;
import io.fd.hc2vpp.common.test.write.WriterCustomizerTest;
import io.fd.hc2vpp.common.translate.util.ByteDataTranslator;
+import io.fd.hc2vpp.common.translate.util.MplsLabelTranslator;
import io.fd.hc2vpp.common.translate.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.vpp.jvpp.core.dto.MplsRouteAddDel;
import io.fd.vpp.jvpp.core.dto.MplsRouteAddDelReply;
import io.fd.vpp.jvpp.core.future.FutureJVppCoreFacade;
+import io.fd.vpp.jvpp.core.types.FibMplsLabel;
import org.junit.Test;
import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
@@ -46,7 +48,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.routing.rev
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.routing.types.rev170227.MplsLabel;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-public class SwapAndForwardTest extends WriterCustomizerTest implements ByteDataTranslator {
+public class SwapAndForwardTest extends WriterCustomizerTest implements ByteDataTranslator, MplsLabelTranslator {
private static final String IF_NAME = "local0";
private static final int IF_INDEX = 123;
@@ -117,7 +119,7 @@ public class SwapAndForwardTest extends WriterCustomizerTest implements ByteData
request.mrNextHopSwIfIndex = IF_INDEX;
request.mrNextHopViaLabel = LspWriter.MPLS_LABEL_INVALID; // default value used by make test
request.mrNextHopNOutLabels = 1;
- request.mrNextHopOutLabelStack = new int[] {OUT_LABEL};
+ request.mrNextHopOutLabelStack = new FibMplsLabel[] {translate(OUT_LABEL)};
return request;
}
}