diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2016-10-31 14:37:57 +0100 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-10-31 15:46:07 +0100 |
commit | 51d5709128535d4da018f6ed7570877de6d6f405 (patch) | |
tree | c69ff13d9c3866d7546a921862d7ea7e7620ebf9 /v3po/v3po2vpp/src/test/java/io | |
parent | af201b3a66219b74b684c91895bce30189ccb245 (diff) |
HONEYCOMB-70: add control ping to vpp-state
Change-Id: I7f02841d899465fd2156db0bb79fcc490cd4929f
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io')
2 files changed, 11 insertions, 2 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java index 0b0378755..ab35bb330 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VersionCustomizerTest.java @@ -22,13 +22,15 @@ import static org.mockito.Mockito.when; import io.fd.honeycomb.translate.spi.read.ReaderCustomizer; import io.fd.honeycomb.vpp.test.read.ReaderCustomizerTest; +import io.fd.vpp.jvpp.core.dto.ShowVersion; +import io.fd.vpp.jvpp.core.dto.ShowVersionReply; +import io.fd.vpp.jvpp.dto.ControlPing; +import io.fd.vpp.jvpp.dto.ControlPingReply; import org.junit.Test; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.VppStateBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.vpp.state.Version; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.vpp.state.VersionBuilder; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import io.fd.vpp.jvpp.core.dto.ShowVersion; -import io.fd.vpp.jvpp.core.dto.ShowVersionReply; public class VersionCustomizerTest extends ReaderCustomizerTest<Version, VersionBuilder> { @@ -50,7 +52,9 @@ public class VersionCustomizerTest extends ReaderCustomizerTest<Version, Version reply.buildDirectory = new byte[] {}; when(api.showVersion(any(ShowVersion.class))).thenReturn(future(reply)); + when(api.send(any(ControlPing.class))).thenReturn(future(new ControlPingReply())); getCustomizer().readCurrentAttributes(InstanceIdentifier.create(Version.class), new VersionBuilder(), ctx); verify(api).showVersion(any(ShowVersion.class)); + verify(api).send(any(ControlPing.class)); } }
\ No newline at end of file diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java index 9f3b8a41d..cdb2b0376 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppstate/VppStateTest.java @@ -39,6 +39,8 @@ import io.fd.honeycomb.translate.util.read.registry.CompositeReaderRegistryBuild import io.fd.honeycomb.vpp.test.util.NamingContextHelper; import io.fd.honeycomb.translate.vpp.util.NamingContext; import io.fd.honeycomb.vpp.test.util.FutureProducer; +import io.fd.vpp.jvpp.dto.ControlPing; +import io.fd.vpp.jvpp.dto.ControlPingReply; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -131,6 +133,7 @@ public class VppStateTest implements FutureProducer, NamingContextHelper { .setBuildDirectory("1") .setBranch("2") .setBuildDate("3") + .setPid(0L) .build(); } @@ -141,6 +144,8 @@ public class VppStateTest implements FutureProducer, NamingContextHelper { reply.version = version.getBranch().getBytes(); reply.buildDirectory = version.getBuildDirectory().getBytes(); when(api.showVersion(any(ShowVersion.class))).thenReturn(future(reply)); + // Version Customizer uses ControlPing to obtain PID + when(api.send(any(ControlPing.class))).thenReturn(future(new ControlPingReply())); } private void whenL2FibTableDumpThenReturn(final List<L2FibTableEntry> entryList) { |