summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/test
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2017-08-16 08:09:19 +0200
committerJan Srnicek <jsrnicek@cisco.com>2017-08-16 08:09:19 +0200
commit3a7a67fe142749eb6b41f660d101f3fdffb8b3de (patch)
tree2e565e89ae1b0c39b7e328a5e5dab12a323585ce /v3po/v3po2vpp/src/test
parentc14b1fd0cee29fc2cd9d1ff395bdf2209f79bd48 (diff)
HC2VPP-22 - Interconnetion improvements
Change-Id: I0abb937df505663ecbae47f4c4a75681b3ff75be Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test')
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/L2CustomizerTest.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/L2CustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/L2CustomizerTest.java
index 53934ff80..f3640769b 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/L2CustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/hc2vpp/v3po/interfacesstate/L2CustomizerTest.java
@@ -105,7 +105,7 @@ public class L2CustomizerTest extends ReaderCustomizerTest<L2, L2Builder> {
}
@Test
- public void testRead() throws Exception {
+ public void testReadBvi() throws Exception {
final int ifId = 1;
final int bdId = 1;
final String bdName = "bd001";
@@ -123,12 +123,28 @@ public class L2CustomizerTest extends ReaderCustomizerTest<L2, L2Builder> {
getCustomizer().readCurrentAttributes(getL2Id(ifName), builder, ctx);
verify(builder).setInterconnection(generateInterconnection(bdName, true));
+ }
+
+ // split to separate test to avoid using cached value from previous run(cannot mock cache)
+ @Test
+ public void testReadNoBvi() throws Exception {
+ final Map<Integer, SwInterfaceDetails> cachedInterfaceDump = new HashMap<>();
+ final int ifId = 1;
+ final int bdId = 1;
+ final String bdName = "bd001";
+ final String ifName = "eth0.sub0";
+ defineMapping(mappingContext, ifName, ifId, IFC_CTX_NAME);
+ defineMapping(mappingContext, bdName, bdId, BD_CTX_NAME);
+
+ final SwInterfaceDetails ifaceDetails = new SwInterfaceDetails();
+ ifaceDetails.subId = ifId;
+ cachedInterfaceDump.put(ifId, ifaceDetails);
// Not BVI
whenBridgeDomainDumpThenReturn(Collections
.singletonList(generateBdDetails(ifId, 99 /* Different ifc is marked as BVI in bd details */, bdId)));
- builder = mock(L2Builder.class);
+ L2Builder builder = mock(L2Builder.class);
getCustomizer().readCurrentAttributes(getL2Id(ifName), builder, ctx);
verify(builder).setInterconnection(generateInterconnection(bdName, null));