diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2018-07-03 09:56:58 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2018-07-03 10:38:42 +0200 |
commit | e5768e2dd1721bd454d2ddbd4e6dc647a5daebe5 (patch) | |
tree | 28e4feaf4354cedc17fcb691c9ac639391315d13 /v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceRoutingCustomizerTest.java | |
parent | ec365fe22b9f52fce8daa667c0f0fa9cc25e64f6 (diff) |
HC2VPP-346: use fib-table-list-ref for FIB to ifc assignment
Change-Id: Ie57776ab9784b7c57630b7ea9ce9b96b71feb5a5
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceRoutingCustomizerTest.java')
-rw-r--r-- | v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceRoutingCustomizerTest.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceRoutingCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceRoutingCustomizerTest.java index e7e108746..3b3de2ae8 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceRoutingCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/SubInterfaceRoutingCustomizerTest.java @@ -37,6 +37,7 @@ import org.mockito.Captor; 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; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.fib.table.management.rev180521.VniReference; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev180319.SubinterfaceAugmentation; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev180319.interfaces._interface.SubInterfaces; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.vlan.rev180319.interfaces._interface.sub.interfaces.SubInterface; @@ -82,21 +83,21 @@ public class SubInterfaceRoutingCustomizerTest extends WriterCustomizerTest impl @Test(expected = IllegalStateException.class) public void testWriteFailedV4AddressPresent() throws WriteFailedException { when(writeContext.readBefore(any(InstanceIdentifier.class))).thenReturn(Optional.of(v4AddressPresent())); - final Routing v4Routing = new RoutingBuilder().setIpv4VrfId(4L).build(); + final Routing v4Routing = new RoutingBuilder().setIpv4VrfId(new VniReference(4L)).build(); customizer.writeCurrentAttributes(VALID_ID, v4Routing, writeContext); } @Test(expected = IllegalStateException.class) public void testWriteFailedV6AddressPresent() throws WriteFailedException { when(writeContext.readBefore(any(InstanceIdentifier.class))).thenReturn(Optional.of(v6AddressPresent())); - final Routing v4Routing = new RoutingBuilder().setIpv4VrfId(4L).build(); + final Routing v4Routing = new RoutingBuilder().setIpv4VrfId(new VniReference(4L)).build(); customizer.writeCurrentAttributes(VALID_ID, v4Routing, writeContext); } @Test public void testWriteIpv4Vrf() throws WriteFailedException { when(writeContext.readBefore(any(InstanceIdentifier.class))).thenReturn(Optional.absent()); - final Routing v4Routing = new RoutingBuilder().setIpv4VrfId(4L).build(); + final Routing v4Routing = new RoutingBuilder().setIpv4VrfId(new VniReference(4L)).build(); customizer.writeCurrentAttributes(VALID_ID, v4Routing, writeContext); verifySetTableRequest(1, Collections.singleton(request(false, SUBIF_INDEX, 4))); } @@ -105,7 +106,7 @@ public class SubInterfaceRoutingCustomizerTest extends WriterCustomizerTest impl @Test public void testWriteIpv6Vrf() throws WriteFailedException { when(writeContext.readBefore(any(InstanceIdentifier.class))).thenReturn(Optional.absent()); - final Routing v6Routing = new RoutingBuilder().setIpv6VrfId(3L).build(); + final Routing v6Routing = new RoutingBuilder().setIpv6VrfId(new VniReference(3L)).build(); customizer.writeCurrentAttributes(VALID_ID, v6Routing, writeContext); verifySetTableRequest(1, Collections.singleton(request(true, SUBIF_INDEX, 3))); } @@ -113,8 +114,10 @@ public class SubInterfaceRoutingCustomizerTest extends WriterCustomizerTest impl @Test public void testUpdateIpv4Vrf() throws WriteFailedException { when(writeContext.readBefore(any(InstanceIdentifier.class))).thenReturn(Optional.absent()); - final Routing routingBefore = new RoutingBuilder().setIpv6VrfId(3L).setIpv4VrfId(4L).build(); - final Routing routingAfter = new RoutingBuilder().setIpv6VrfId(3L).setIpv4VrfId(5L).build(); + final Routing routingBefore = new RoutingBuilder().setIpv6VrfId(new VniReference(3L)) + .setIpv4VrfId(new VniReference(4L)).build(); + final Routing routingAfter = new RoutingBuilder().setIpv6VrfId(new VniReference(3L)) + .setIpv4VrfId(new VniReference(5L)).build(); customizer.updateCurrentAttributes(VALID_ID, routingBefore, routingAfter, writeContext); verifySetTableRequest(2, ImmutableSet.of(request(false, SUBIF_INDEX, 5), request(true, SUBIF_INDEX, 3))); @@ -123,8 +126,10 @@ public class SubInterfaceRoutingCustomizerTest extends WriterCustomizerTest impl @Test public void testUpdateIpv6Vrf() throws WriteFailedException { when(writeContext.readBefore(any(InstanceIdentifier.class))).thenReturn(Optional.absent()); - final Routing routingBefore = new RoutingBuilder().setIpv6VrfId(3L).setIpv4VrfId(4L).build(); - final Routing routingAfter = new RoutingBuilder().setIpv6VrfId(8L).setIpv4VrfId(4L).build(); + final Routing routingBefore = new RoutingBuilder().setIpv6VrfId(new VniReference(3L)) + .setIpv4VrfId(new VniReference(4L)).build(); + final Routing routingAfter = new RoutingBuilder().setIpv6VrfId(new VniReference(8L)) + .setIpv4VrfId(new VniReference(4L)).build(); customizer.updateCurrentAttributes(VALID_ID, routingBefore, routingAfter, writeContext); verifySetTableRequest(2, ImmutableSet.of(request(false, SUBIF_INDEX, 4), request(true, SUBIF_INDEX, 8))); @@ -133,7 +138,7 @@ public class SubInterfaceRoutingCustomizerTest extends WriterCustomizerTest impl @Test public void testDeleteIpv4Vrf() throws WriteFailedException { when(writeContext.readAfter(any(InstanceIdentifier.class))).thenReturn(Optional.absent()); - final Routing v4Routing = new RoutingBuilder().setIpv4VrfId(4L).build(); + final Routing v4Routing = new RoutingBuilder().setIpv4VrfId(new VniReference(4L)).build(); customizer.deleteCurrentAttributes(VALID_ID, v4Routing, writeContext); verifySetTableRequest(1, Collections.singleton(request(false, SUBIF_INDEX, DISABLE_VRF))); } @@ -142,7 +147,7 @@ public class SubInterfaceRoutingCustomizerTest extends WriterCustomizerTest impl @Test public void testDeleteIpv6Vrf() throws WriteFailedException { when(writeContext.readAfter(any(InstanceIdentifier.class))).thenReturn(Optional.absent()); - final Routing v6Routing = new RoutingBuilder().setIpv6VrfId(3L).build(); + final Routing v6Routing = new RoutingBuilder().setIpv6VrfId(new VniReference(3L)).build(); customizer.deleteCurrentAttributes(VALID_ID, v6Routing, writeContext); verifySetTableRequest(1, Collections.singleton(request(true, SUBIF_INDEX, DISABLE_VRF))); } |