diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2017-10-31 08:50:10 +0100 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2017-10-31 16:58:35 +0000 |
commit | afc8a4633b0a43173dc0bdba5f678148ae7e58a7 (patch) | |
tree | de1b55303f72770eecabc32ab0146a3d7a0a988d /v3po/v3po2vpp/src/test | |
parent | 5577ff50e82bbd771bcdb088e1f08e2bfd940b2a (diff) |
Adapt to mac address representation change in l2.api
https://gerrit.fd.io/r/#/c/9090/ changes mac representation
from u64 to u8[]
Change-Id: Ia82d5652926f8bd10c1c8fc3ad0e147b35dbee4c
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test')
3 files changed, 16 insertions, 15 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslatorTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslatorTest.java index 40bb6b91b..c58409754 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslatorTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/InterfaceDataTranslatorTest.java @@ -30,7 +30,7 @@ public class InterfaceDataTranslatorTest implements InterfaceDataTranslator { @Test public void testVppPhysAddrToYang() throws Exception { assertEquals("01:02:03:04:05:06", vppPhysAddrToYang(new byte[]{1, 2, 3, 4, 5, 6})); - assertEquals("0a:0b:0c:0d:0e:0f", vppPhysAddrToYang(new byte[]{0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0, 0})); + assertEquals("0a:0b:0c:0d:0e:0f", vppPhysAddrToYang(new byte[]{0xa, 0xb, 0xc, 0xd, 0xe, 0xf})); } @Test(expected = NullPointerException.class) diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizerTest.java index 2b096507d..54faa9a1d 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2/L2FibEntryCustomizerTest.java @@ -16,6 +16,7 @@ package io.fd.hc2vpp.v3po.l2; +import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -81,7 +82,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { doReturn(failedFuture()).when(api).l2FibAddDel(any(L2FibAddDel.class)); } - private L2FibAddDel generateL2FibAddDelFilterRequest(final long mac, final byte isAdd, final int ifaceIndex) { + private L2FibAddDel generateL2FibAddDelFilterRequest(final byte[] mac, final byte isAdd, final int ifaceIndex) { final L2FibAddDel request = new L2FibAddDel(); request.mac = mac; request.bdId = BD_ID; @@ -94,7 +95,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { return request; } - private L2FibAddDel generateL2FibAddDelForwardRequest(final long mac, final byte isAdd, final int ifaceIndex) { + private L2FibAddDel generateL2FibAddDelForwardRequest(final byte[] mac, final byte isAdd, final int ifaceIndex) { final L2FibAddDel request = new L2FibAddDel(); request.mac = mac; request.bdId = BD_ID; @@ -134,7 +135,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { ArgumentCaptor<L2FibAddDel> argumentCaptor = ArgumentCaptor.forClass(L2FibAddDel.class); verify(api).l2FibAddDel(argumentCaptor.capture()); final L2FibAddDel actual = argumentCaptor.getValue(); - assertEquals(expected.mac, actual.mac); + assertArrayEquals(expected.mac, actual.mac); assertEquals(expected.bdId, actual.bdId); assertEquals(expected.swIfIndex, actual.swIfIndex); assertEquals(expected.isAdd, actual.isAdd); @@ -144,7 +145,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { @Test public void testCreateFilter() throws Exception { - final long address_vpp = 0x0102030405060000L; + final byte[] address_vpp = new byte[]{1, 2, 3, 4, 5, 6}; final PhysAddress address = new PhysAddress("01:02:03:04:05:06"); final L2FibEntry entry = generateL2FibFilterEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); @@ -158,7 +159,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { @Test public void testCreateForward() throws Exception { - final long address_vpp = 0x0102030405060000L; + final byte[] address_vpp = new byte[]{1, 2, 3, 4, 5, 6}; final PhysAddress address = new PhysAddress("01:02:03:04:05:06"); final L2FibEntry entry = generateL2FibForwardEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); @@ -172,7 +173,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { @Test public void testCreateFilterFailed() throws Exception { - final long address_vpp = 0x1122334455660000L; + final byte[] address_vpp = new byte[]{0x11, 0x22 ,0x33, 0x44 ,0x55, 0x66}; final PhysAddress address = new PhysAddress("11:22:33:44:55:66"); final L2FibEntry entry = generateL2FibFilterEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); @@ -191,7 +192,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { @Test public void testCreateForwardFailed() throws Exception { - final long address_vpp = 0x1122334455660000L; + final byte[] address_vpp = new byte[]{0x11, 0x22 ,0x33, 0x44 ,0x55, 0x66}; final PhysAddress address = new PhysAddress("11:22:33:44:55:66"); final L2FibEntry entry = generateL2FibForwardEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); @@ -216,7 +217,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { @Test public void testDeleteFilter() throws Exception { - final long address_vpp = 0x1122334455660000L; + final byte[] address_vpp = new byte[]{0x11, 0x22 ,0x33, 0x44 ,0x55, 0x66}; final PhysAddress address = new PhysAddress("11:22:33:44:55:66"); final L2FibEntry entry = generateL2FibFilterEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); @@ -230,7 +231,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { @Test public void testDeleteForward() throws Exception { - final long address_vpp = 0x1122334455660000L; + final byte[] address_vpp = new byte[]{0x11, 0x22 ,0x33, 0x44 ,0x55, 0x66}; final PhysAddress address = new PhysAddress("11:22:33:44:55:66"); final L2FibEntry entry = generateL2FibForwardEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); @@ -245,7 +246,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { @Test public void testDeleteFilterFailed() throws Exception { - final long address_vpp = 0x0102030405060000L; + final byte[] address_vpp = new byte[]{1, 2, 3, 4, 5, 6}; final PhysAddress address = new PhysAddress("01:02:03:04:05:06"); final L2FibEntry entry = generateL2FibFilterEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); @@ -264,7 +265,7 @@ public class L2FibEntryCustomizerTest extends WriterCustomizerTest { @Test public void testDeleteForwardFailed() throws Exception { - final long address_vpp = 0x0102030405060000L; + final byte[] address_vpp = new byte[]{1, 2, 3, 4, 5, 6}; final PhysAddress address = new PhysAddress("01:02:03:04:05:06"); final L2FibEntry entry = generateL2FibForwardEntry(address); final InstanceIdentifier<L2FibEntry> id = getL2FibEntryId(address); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizerTest.java index a8e200edd..40dbe797b 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/l2state/L2FibEntryCustomizerTest.java @@ -86,7 +86,7 @@ public class L2FibEntryCustomizerTest extends ListReaderCustomizerTest<L2FibEntr @Test public void testRead() throws Exception { - final long address_vpp = 0x0000010203040506L; + final byte[] address_vpp = new byte[]{1, 2, 3, 4, 5, 6}; final PhysAddress address = new PhysAddress("01:02:03:04:05:06"); defineMapping(mappingContext, IFACE_NAME, IFACE_ID, IFC_CTX_NAME); @@ -103,7 +103,7 @@ public class L2FibEntryCustomizerTest extends ListReaderCustomizerTest<L2FibEntr verify(builder).setKey(new L2FibEntryKey(address)); } - private L2FibTableDetails generateL2FibEntry(final long mac) { + private L2FibTableDetails generateL2FibEntry(final byte[] mac) { final L2FibTableDetails entry = new L2FibTableDetails(); entry.mac = mac; entry.swIfIndex = IFACE_ID; @@ -112,7 +112,7 @@ public class L2FibEntryCustomizerTest extends ListReaderCustomizerTest<L2FibEntr @Test public void testGetAllIds() throws Exception { - final long address_vpp = 0x0000112233445566L; + final byte[] address_vpp = new byte[]{0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; final PhysAddress address = new PhysAddress("11:22:33:44:55:66"); whenL2FibTableDumpThenReturn(Collections.singletonList(generateL2FibEntry(address_vpp))); |