summaryrefslogtreecommitdiffstats
path: root/dhcp/dhcp-impl/src/test/java/io
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-06-29 14:36:59 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-07-02 09:14:58 +0000
commitc428881044008b3865c8e934dd53240b43c084f1 (patch)
treee837648703bd2350280f2f4c2a6940ad96d3001b /dhcp/dhcp-impl/src/test/java/io
parentae927860249b060ed4f9a8e0f3df8df7ec2e269c (diff)
HC2VPP-348: use vpp-fib-management module instead of FIB table index
Change-Id: Iba1f6d4c556c8ef839eb309b990f32945e6494fb Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'dhcp/dhcp-impl/src/test/java/io')
-rw-r--r--dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/helpers/SchemaContextTestHelper.java2
-rw-r--r--dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizerTest.java27
-rw-r--r--dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizerTest.java19
3 files changed, 25 insertions, 23 deletions
diff --git a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/helpers/SchemaContextTestHelper.java b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/helpers/SchemaContextTestHelper.java
index bb417eef1..3c1cdadeb 100644
--- a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/helpers/SchemaContextTestHelper.java
+++ b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/helpers/SchemaContextTestHelper.java
@@ -27,7 +27,7 @@ public interface SchemaContextTestHelper extends InjectablesProcessor {
default ModuleInfoBackedContext getSchemaContext() {
return provideSchemaContextFor(ImmutableSet.of(
// dhcp
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.$YangModuleInfoImpl
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.$YangModuleInfoImpl
.getInstance()
));
}
diff --git a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizerTest.java b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizerTest.java
index 904a2a208..500063d5a 100644
--- a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizerTest.java
+++ b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/read/DhcpRelayCustomizerTest.java
@@ -31,24 +31,25 @@ import io.fd.vpp.jvpp.core.dto.DhcpProxyDump;
import io.fd.vpp.jvpp.core.types.DhcpServer;
import java.util.List;
import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Dhcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Ipv6;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.Relays;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.RelaysBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.Relay;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.RelayBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.RelayKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.relay.attributes.Server;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.Dhcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.Relays;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.RelaysBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.Relay;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.RelayBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.RelayKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.relay.attributes.Server;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv6;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.VniReference;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
public class DhcpRelayCustomizerTest extends InitializingListReaderCustomizerTest<Relay, RelayKey, RelayBuilder> {
private static InstanceIdentifier<Relays> RELAYS = InstanceIdentifier.create(Dhcp.class).child(Relays.class);
private KeyedInstanceIdentifier<Relay, RelayKey> IP4_IID =
- RELAYS.child(Relay.class, new RelayKey(Ipv4.class, 123L));
+ RELAYS.child(Relay.class, new RelayKey(Ipv4.class, new VniReference(123L)));
private KeyedInstanceIdentifier<Relay, RelayKey> IP6_IID =
- RELAYS.child(Relay.class, new RelayKey(Ipv6.class, 321L));
+ RELAYS.child(Relay.class, new RelayKey(Ipv6.class, new VniReference(321L)));
public DhcpRelayCustomizerTest() {
super(Relay.class, RelaysBuilder.class);
}
@@ -104,7 +105,7 @@ public class DhcpRelayCustomizerTest extends InitializingListReaderCustomizerTes
public void testReadIp4() throws ReadFailedException {
final RelayBuilder builder = new RelayBuilder();
getCustomizer().readCurrentAttributes(IP4_IID, builder, ctx);
- assertEquals(IP4_IID.getKey().getAddressType(), builder.getAddressType());
+ assertEquals(IP4_IID.getKey().getAddressFamily(), builder.getAddressFamily());
assertEquals(IP4_IID.getKey().getRxVrfId(), builder.getRxVrfId());
assertArrayEquals("1.2.3.4".toCharArray(), builder.getGatewayAddress().getValue());
final List<Server> server = builder.getServer();
@@ -119,7 +120,7 @@ public class DhcpRelayCustomizerTest extends InitializingListReaderCustomizerTes
public void testReadIp6() throws ReadFailedException {
final RelayBuilder builder = new RelayBuilder();
getCustomizer().readCurrentAttributes(IP6_IID, builder, ctx);
- assertEquals(IP6_IID.getKey().getAddressType(), builder.getAddressType());
+ assertEquals(IP6_IID.getKey().getAddressFamily(), builder.getAddressFamily());
assertEquals(IP6_IID.getKey().getRxVrfId(), builder.getRxVrfId());
assertEquals(22L, builder.getServer().get(0).getVrfId().longValue());
assertArrayEquals("2001:db8:a0b:12f0::1".toCharArray(), builder.getGatewayAddress().getValue());
diff --git a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizerTest.java b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizerTest.java
index 29ceb43f9..4e4e02f35 100644
--- a/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizerTest.java
+++ b/dhcp/dhcp-impl/src/test/java/io/fd/hc2vpp/dhcp/write/DhcpRelayCustomizerTest.java
@@ -29,13 +29,14 @@ import io.fd.vpp.jvpp.core.dto.DhcpProxyConfig;
import io.fd.vpp.jvpp.core.dto.DhcpProxyConfigReply;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.AddressFamily;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Dhcp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Ipv4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.Ipv6;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.Relays;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.Relay;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180103.dhcp.attributes.relays.RelayKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.Dhcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.Relays;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.Relay;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.dhcp.rev180629.dhcp.attributes.relays.RelayKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.AddressFamilyIdentity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.Ipv6;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.VniReference;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@RunWith(HoneycombTestRunner.class)
@@ -106,7 +107,7 @@ public class DhcpRelayCustomizerTest extends WriterCustomizerTest implements Sch
verify(api).dhcpProxyConfig(request);
}
- private InstanceIdentifier<Relay> getId(final long rxVrfId, final Class<? extends AddressFamily> addressType) {
- return RELAYS_IID.child(Relay.class, new RelayKey(addressType, rxVrfId));
+ private InstanceIdentifier<Relay> getId(final long rxVrfId, final Class<? extends AddressFamilyIdentity> addressType) {
+ return RELAYS_IID.child(Relay.class, new RelayKey(addressType, new VniReference(rxVrfId)));
}
} \ No newline at end of file