From 076ed09e9eaeeb751ce87bac67ae0becc7b2417b Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Mon, 11 Jun 2018 16:45:47 +0200 Subject: HC2VPP-354: use hw_interface_set_mtu for Ethernet interfaces The API was renamed by https://gerrit.fd.io/r/#/c/12930/ The VPP change spearates setting of hardware interface and software interface MTU. More details: https://git.fd.io/vpp/tree/src/vnet/MTU.md HC supports only hardware interface MTU configuration for Ethernet interfaces. MTU for software interfaces (per protocol MTU) is not supported (HC2VPP-355). Change-Id: I7eb1cb035a7b0f428a7bc7a9bb1c73819b52f0fa Signed-off-by: Marek Gradzki --- .../hc2vpp/v3po/interfaces/EthernetCustomizerTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'v3po/v3po2vpp/src/test/java') diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizerTest.java index eb47fddfb..6ddcc9bb2 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfaces/EthernetCustomizerTest.java @@ -24,8 +24,8 @@ import static org.mockito.Mockito.when; import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.honeycomb.translate.write.WriteFailedException; -import io.fd.vpp.jvpp.core.dto.SwInterfaceSetMtu; -import io.fd.vpp.jvpp.core.dto.SwInterfaceSetMtuReply; +import io.fd.vpp.jvpp.core.dto.HwInterfaceSetMtu; +import io.fd.vpp.jvpp.core.dto.HwInterfaceSetMtuReply; import org.junit.Test; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.EthernetCsmacd; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces; @@ -55,22 +55,22 @@ public class EthernetCustomizerTest extends WriterCustomizerTest { @Test public void testWrite() throws WriteFailedException { - when(api.swInterfaceSetMtu(any())).thenReturn(future(new SwInterfaceSetMtuReply())); + when(api.hwInterfaceSetMtu(any())).thenReturn(future(new HwInterfaceSetMtuReply())); final int mtu = 1234; customizer.writeCurrentAttributes(IF_IID, ethernet(mtu), writeContext); - verify(api).swInterfaceSetMtu(mtuSetRequest(mtu)); + verify(api).hwInterfaceSetMtu(mtuSetRequest(mtu)); } @Test public void testUpdate() throws WriteFailedException { - when(api.swInterfaceSetMtu(any())).thenReturn(future(new SwInterfaceSetMtuReply())); + when(api.hwInterfaceSetMtu(any())).thenReturn(future(new HwInterfaceSetMtuReply())); final int mtu = 5678; customizer.updateCurrentAttributes(IF_IID, mock(Ethernet.class), ethernet(mtu), writeContext); - verify(api).swInterfaceSetMtu(mtuSetRequest(mtu)); + verify(api).hwInterfaceSetMtu(mtuSetRequest(mtu)); } - private SwInterfaceSetMtu mtuSetRequest(final int mtu) { - final SwInterfaceSetMtu request = new SwInterfaceSetMtu(); + private HwInterfaceSetMtu mtuSetRequest(final int mtu) { + final HwInterfaceSetMtu request = new HwInterfaceSetMtu(); request.swIfIndex = IF_INDEX; request.mtu = (short)mtu; return request; -- cgit 1.2.3-korg