diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2016-05-26 14:52:20 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-05-30 07:20:40 +0200 |
commit | 3c15fa224a914aa9e03ae2e97fab1e740a0f8b04 (patch) | |
tree | b3b93894ac36b4d143f10337421777a7cfb78ef3 | |
parent | fc4f291590e29f7d576793041ece4081d28c0027 (diff) |
Fix vlan type handling for sub interfaces and vlan-tag-rewrite operation
Change-Id: I932fb63932d9c53acc6317fa77cc0683faf47081
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
6 files changed, 7 insertions, 5 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizer.java index 17342e347..499d98048 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizer.java @@ -116,7 +116,7 @@ public class SubInterfaceCustomizer extends AbstractInterfaceTypeCustomizer<SubI request.twoTags = 1; break; } - request.dot1Ad = booleanToByte(VlanType._802dot1q.equals(subInterface.getVlanType())); + request.dot1Ad = booleanToByte(VlanType._802dot1ad.equals(subInterface.getVlanType())); request.exactMatch = booleanToByte(subInterface.isExactMatch()); request.defaultSub = booleanToByte(subInterface.isDefaultSubif()); request.outerVlanIdAny = booleanToByte(subInterface.isMatchAnyInnerId()); diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizer.java index ebd1cff40..45ef0b490 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizer.java @@ -92,7 +92,7 @@ public class SubInterfaceCustomizer extends FutureJVppCustomizer builder.setIdentifier(Long.valueOf(iface.subId)); builder.setSuperInterface(interfaceContext.getName(iface.supSwIfIndex, ctx.getMappingContext())); builder.setNumberOfTags(Short.valueOf(iface.subNumberOfTags)); - builder.setVlanType(iface.subDot1Ad == 1 ? VlanType._802dot1q : VlanType._802dot1ad); + builder.setVlanType(iface.subDot1Ad == 1 ? VlanType._802dot1ad : VlanType._802dot1q); if (iface.subExactMatch == 1) { builder.setExactMatch(true); } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VlanTagRewriteCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VlanTagRewriteCustomizer.java index e6b8b36fc..20429253f 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VlanTagRewriteCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VlanTagRewriteCustomizer.java @@ -84,7 +84,7 @@ public class VlanTagRewriteCustomizer extends FutureJVppCustomizer return; } - builder.setFirstPushed(iface.subDot1Ad == 1 ? VlanType._802dot1q : VlanType._802dot1ad); + builder.setFirstPushed(iface.vtrPushDot1Q == 1 ? VlanType._802dot1q : VlanType._802dot1ad); builder.setRewriteOperation(TagRewriteOperation.forValue(iface.vtrOp)); if (iface.vtrTag1 != 0) { builder.setTag1(new VlanTag(iface.vtrTag1)); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizerTest.java index 31ab3aab5..0b4279126 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizerTest.java @@ -79,7 +79,7 @@ public class SubInterfaceCustomizerTest { private SubInterface generateSubInterface(final String superIfName) { SubInterfaceBuilder builder = new SubInterfaceBuilder(); - builder.setVlanType(VlanType._802dot1q); + builder.setVlanType(VlanType._802dot1ad); builder.setIdentifier(11L); builder.setNumberOfTags((short)1); builder.setOuterId(new VlanTag(100)); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java index 4f6857b47..0addcee58 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/SubInterfaceCustomizerTest.java @@ -101,6 +101,7 @@ public class SubInterfaceCustomizerTest extends ChildReaderCustomizerTest<SubInt final SwInterfaceDetails ifaceDetails = new SwInterfaceDetails(); ifaceDetails.subId = ifId; ifaceDetails.interfaceName = ifName.getBytes(); + ifaceDetails.subDot1Ad = 1; cachedInterfaceDump.put(ifId, ifaceDetails); cache.put(InterfaceCustomizer.DUMPED_IFCS_CONTEXT_KEY, cachedInterfaceDump); diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VlanTagRewriteCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VlanTagRewriteCustomizerTest.java index 4173eba3c..78c9e266e 100644 --- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VlanTagRewriteCustomizerTest.java +++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/v3po/translate/v3po/interfacesstate/VlanTagRewriteCustomizerTest.java @@ -86,13 +86,14 @@ public class VlanTagRewriteCustomizerTest extends ChildReaderCustomizerTest<Vlan final SwInterfaceDetails ifaceDetails = new SwInterfaceDetails(); ifaceDetails.subId = ifId; ifaceDetails.interfaceName = ifName.getBytes(); + ifaceDetails.vtrPushDot1Q = 1; cachedInterfaceDump.put(ifId, ifaceDetails); cache.put(InterfaceCustomizer.DUMPED_IFCS_CONTEXT_KEY, cachedInterfaceDump); final VlanTagRewriteBuilder builder = mock(VlanTagRewriteBuilder.class); getCustomizer().readCurrentAttributes(getVlanTagRewriteId(ifName), builder, ctx); - verify(builder).setFirstPushed(VlanType._802dot1ad); + verify(builder).setFirstPushed(VlanType._802dot1q); verify(builder).setRewriteOperation(TagRewriteOperation.Disabled); verify(builder, never()).setTag1(any()); verify(builder, never()).setTag2(any()); |