summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/test
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-10-10 14:55:15 +0200
committerMaros Marsalek <mmarsale@cisco.com>2016-10-13 11:27:29 +0000
commite90041d108c7c72901ddda0124a71fbb7c582cca (patch)
tree2166bcf4eaa6cba90fb0a852b49c0981fc4404e4 /v3po/v3po2vpp/src/test
parent5d4de31ab3a6c7b1b1759fcb8a227492c770d61c (diff)
HONEYCOMB-233: add support for mixing L2/L3 rules
In case of L2 interfaces, acls are translated into a chain of classify tables and assigned as L2 table. In case of L3 interfaces, acls are translated into ip4 and ip6 chains (eth only rules go to both chains, rest - depending on ip-version). Limitations: - it is not possible to define L3 rule without specifying ip-version (common header fields for IP4/IP6 have different offsets), - eth rules on L3 interfaces are applied only to IP traffic (vpp classfier limitation). Change-Id: I7ca2648cabad8c6e936cf71a51e06596a42891e8 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test')
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceEthWriterTest.java31
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp4WriterTest.java41
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp6WriterTest.java41
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIpAndEthWriterTest.java114
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java2
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizerTest.java5
6 files changed, 149 insertions, 85 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceEthWriterTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceEthWriterTest.java
index 1a89a5d98..546de89d7 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceEthWriterTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceEthWriterTest.java
@@ -22,11 +22,8 @@ import static org.mockito.MockitoAnnotations.initMocks;
import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSession;
import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.actions.PacketHandling;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.actions.packet.handling.DenyBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.matches.ace.type.AceEth;
@@ -36,8 +33,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.acl.
public class AceEthWriterTest {
- @Mock
- private FutureJVppCore jvpp;
private AceEthWriter writer;
private PacketHandling action;
private AceEth aceEth;
@@ -45,7 +40,7 @@ public class AceEthWriterTest {
@Before
public void setUp() {
initMocks(this);
- writer = new AceEthWriter(jvpp);
+ writer = new AceEthWriter();
action = new DenyBuilder().setDeny(true).build();
aceEth = new AceEthBuilder()
.setDestinationMacAddress(new MacAddress("11:22:33:44:55:66"))
@@ -56,9 +51,9 @@ public class AceEthWriterTest {
}
@Test
- public void testCreateClassifyTable() {
+ public void testCreateTable() {
final int nextTableIndex = 42;
- final ClassifyAddDelTable request = writer.createClassifyTable(aceEth, InterfaceMode.L2, nextTableIndex, 0);
+ final ClassifyAddDelTable request = writer.createTable(aceEth, InterfaceMode.L2, nextTableIndex, 0);
assertEquals(1, request.isAdd);
assertEquals(-1, request.tableIndex);
@@ -78,15 +73,10 @@ public class AceEthWriterTest {
assertArrayEquals(expectedMask, request.mask);
}
- @Test(expected = IllegalArgumentException.class)
- public void testCreateClassifyTableForL3Interface() {
- writer.createClassifyTable(aceEth, InterfaceMode.L3, 42, 0);
- }
-
@Test
public void testCreateClassifySession() {
final int tableIndex = 123;
- final ClassifyAddDelSession request = writer.createClassifySession(action, aceEth, InterfaceMode.L2, tableIndex, 0);
+ final ClassifyAddDelSession request = writer.createSession(action, aceEth, InterfaceMode.L2, tableIndex, 0);
assertEquals(1, request.isAdd);
assertEquals(tableIndex, request.tableIndex);
@@ -101,17 +91,4 @@ public class AceEthWriterTest {
};
assertArrayEquals(expectedMatch, request.match);
}
-
- @Test(expected = IllegalArgumentException.class)
- public void testCreateClassifySessionForL3Interface() {
- writer.createClassifySession(action, aceEth, InterfaceMode.L3, 42, 0);
- }
-
- @Test
- public void testSetClassifyTable() {
- final int tableIndex = 321;
- final InputAclSetInterface request = new InputAclSetInterface();
- writer.setClassifyTable(request, tableIndex);
- assertEquals(tableIndex, request.l2TableIndex);
- }
} \ No newline at end of file
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp4WriterTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp4WriterTest.java
index 1a7045529..258a937ac 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp4WriterTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp4WriterTest.java
@@ -16,17 +16,14 @@
package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
-import static io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.AbstractAceWriter.VLAN_TAG_LEN;
+import static io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.AclTranslator.VLAN_TAG_LEN;
import static org.junit.Assert.assertEquals;
import static org.mockito.MockitoAnnotations.initMocks;
import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSession;
import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.actions.PacketHandling;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.actions.packet.handling.DenyBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIp;
@@ -38,8 +35,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.acl.
public class AceIp4WriterTest {
- @Mock
- private FutureJVppCore jvpp;
private AceIp4Writer writer;
private PacketHandling action;
private AceIp aceIp;
@@ -47,7 +42,7 @@ public class AceIp4WriterTest {
@Before
public void setUp() throws Exception {
initMocks(this);
- writer = new AceIp4Writer(jvpp);
+ writer = new AceIp4Writer();
action = new DenyBuilder().setDeny(true).build();
aceIp = new AceIpBuilder()
.setProtocol((short) 132)
@@ -120,46 +115,46 @@ public class AceIp4WriterTest {
}
@Test
- public void testCreateClassifyTable() throws Exception {
+ public void testCreateTable() throws Exception {
final int nextTableIndex = 42;
- final ClassifyAddDelTable request = writer.createClassifyTable(aceIp, InterfaceMode.L3, nextTableIndex, 0);
+ final ClassifyAddDelTable request = writer.createTable(aceIp, InterfaceMode.L3, nextTableIndex, 0);
verifyTableRequest(request, nextTableIndex, 0, false);
}
@Test
- public void testCreateClassifyTableForL2Interface() throws Exception {
+ public void testCreateTableForL2Interface() throws Exception {
final int nextTableIndex = 42;
- final ClassifyAddDelTable request = writer.createClassifyTable(aceIp, InterfaceMode.L2, nextTableIndex, 0);
+ final ClassifyAddDelTable request = writer.createTable(aceIp, InterfaceMode.L2, nextTableIndex, 0);
verifyTableRequest(request, nextTableIndex, 0, true);
}
@Test
- public void testCreateClassifyTable1VlanTag() throws Exception {
+ public void testCreateTable1VlanTag() throws Exception {
final int nextTableIndex = 42;
final int vlanTags = 1;
- final ClassifyAddDelTable request = writer.createClassifyTable(aceIp, InterfaceMode.L3, nextTableIndex, vlanTags);
+ final ClassifyAddDelTable request = writer.createTable(aceIp, InterfaceMode.L3, nextTableIndex, vlanTags);
verifyTableRequest(request, nextTableIndex, vlanTags, false);
}
@Test
- public void testCreateClassifyTable2VlanTags() throws Exception {
+ public void testCreateTable2VlanTags() throws Exception {
final int nextTableIndex = 42;
final int vlanTags = 2;
- final ClassifyAddDelTable request = writer.createClassifyTable(aceIp, InterfaceMode.L3, nextTableIndex, vlanTags);
+ final ClassifyAddDelTable request = writer.createTable(aceIp, InterfaceMode.L3, nextTableIndex, vlanTags);
verifyTableRequest(request, nextTableIndex, vlanTags, false);
}
@Test
public void testCreateClassifySession() throws Exception {
final int tableIndex = 123;
- final ClassifyAddDelSession request = writer.createClassifySession(action, aceIp, InterfaceMode.L3, tableIndex, 0);
+ final ClassifyAddDelSession request = writer.createSession(action, aceIp, InterfaceMode.L3, tableIndex, 0);
verifySessionRequest(request, tableIndex, 0, false);
}
@Test
public void testCreateClassifySessionForL2Interface() throws Exception {
final int tableIndex = 123;
- final ClassifyAddDelSession request = writer.createClassifySession(action, aceIp, InterfaceMode.L2, tableIndex, 0);
+ final ClassifyAddDelSession request = writer.createSession(action, aceIp, InterfaceMode.L2, tableIndex, 0);
verifySessionRequest(request, tableIndex, 0, true);
}
@@ -167,7 +162,7 @@ public class AceIp4WriterTest {
public void testCreateClassifySession1VlanTag() throws Exception {
final int tableIndex = 123;
final int vlanTags = 1;
- final ClassifyAddDelSession request = writer.createClassifySession(action, aceIp, InterfaceMode.L3, tableIndex, vlanTags);
+ final ClassifyAddDelSession request = writer.createSession(action, aceIp, InterfaceMode.L3, tableIndex, vlanTags);
verifySessionRequest(request, tableIndex, vlanTags, false);
}
@@ -175,16 +170,8 @@ public class AceIp4WriterTest {
public void testCreateClassifySession2VlanTags() throws Exception {
final int tableIndex = 123;
final int vlanTags = 2;
- final ClassifyAddDelSession request = writer.createClassifySession(action, aceIp, InterfaceMode.L3, tableIndex, vlanTags);
+ final ClassifyAddDelSession request = writer.createSession(action, aceIp, InterfaceMode.L3, tableIndex, vlanTags);
verifySessionRequest(request, tableIndex, vlanTags, false);
}
-
- @Test
- public void testSetClassifyTable() throws Exception {
- final int tableIndex = 321;
- final InputAclSetInterface request = new InputAclSetInterface();
- writer.setClassifyTable(request, tableIndex);
- assertEquals(tableIndex, request.ip4TableIndex);
- }
} \ No newline at end of file
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp6WriterTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp6WriterTest.java
index 01eaa454d..08f90557e 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp6WriterTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp6WriterTest.java
@@ -16,17 +16,14 @@
package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
-import static io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.AbstractAceWriter.VLAN_TAG_LEN;
+import static io.fd.honeycomb.translate.v3po.interfaces.acl.ingress.AclTranslator.VLAN_TAG_LEN;
import static org.junit.Assert.assertEquals;
import static org.mockito.MockitoAnnotations.initMocks;
import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSession;
import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
-import io.fd.vpp.jvpp.core.dto.InputAclSetInterface;
-import io.fd.vpp.jvpp.core.future.FutureJVppCore;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Mock;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.actions.PacketHandling;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.actions.packet.handling.DenyBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIp;
@@ -39,8 +36,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.acl.
public class AceIp6WriterTest {
- @Mock
- private FutureJVppCore jvpp;
private AceIp6Writer writer;
private PacketHandling action;
private AceIp aceIp;
@@ -48,7 +43,7 @@ public class AceIp6WriterTest {
@Before
public void setUp() {
initMocks(this);
- writer = new AceIp6Writer(jvpp);
+ writer = new AceIp6Writer();
action = new DenyBuilder().setDeny(true).build();
aceIp = new AceIpBuilder()
.setProtocol((short) 132)
@@ -128,36 +123,36 @@ public class AceIp6WriterTest {
}
@Test
- public void testCreateClassifyTable() {
+ public void testCreateTable() {
final int nextTableIndex = 42;
final ClassifyAddDelTable request =
- writer.createClassifyTable(aceIp, InterfaceMode.L3, nextTableIndex, 0);
+ writer.createTable(aceIp, InterfaceMode.L3, nextTableIndex, 0);
verifyTableRequest(request, nextTableIndex, 0, false);
}
@Test
- public void testCreateClassifyTableForL2Interface() {
+ public void testCreateTableForL2Interface() {
final int nextTableIndex = 42;
final ClassifyAddDelTable request =
- writer.createClassifyTable(aceIp, InterfaceMode.L2, nextTableIndex, 0);
+ writer.createTable(aceIp, InterfaceMode.L2, nextTableIndex, 0);
verifyTableRequest(request, nextTableIndex, 0, true);
}
@Test
- public void testCreateClassifyTable1VlanTag() {
+ public void testCreateTable1VlanTag() {
final int nextTableIndex = 42;
final int vlanTags = 1;
final ClassifyAddDelTable request =
- writer.createClassifyTable(aceIp, InterfaceMode.L3, nextTableIndex, vlanTags);
+ writer.createTable(aceIp, InterfaceMode.L3, nextTableIndex, vlanTags);
verifyTableRequest(request, nextTableIndex, vlanTags, false);
}
@Test
- public void testCreateClassifyTable2VlanTags() {
+ public void testCreateTable2VlanTags() {
final int nextTableIndex = 42;
final int vlanTags = 2;
final ClassifyAddDelTable request =
- writer.createClassifyTable(aceIp, InterfaceMode.L3, nextTableIndex, vlanTags);
+ writer.createTable(aceIp, InterfaceMode.L3, nextTableIndex, vlanTags);
verifyTableRequest(request, nextTableIndex, vlanTags, false);
}
@@ -165,7 +160,7 @@ public class AceIp6WriterTest {
public void testCreateClassifySession() {
final int tableIndex = 123;
final ClassifyAddDelSession request =
- writer.createClassifySession(action, aceIp, InterfaceMode.L3, tableIndex, 0);
+ writer.createSession(action, aceIp, InterfaceMode.L3, tableIndex, 0);
verifySessionRequest(request, tableIndex, 0, false);
}
@@ -173,7 +168,7 @@ public class AceIp6WriterTest {
public void testCreateClassifySessionForL2Interface() {
final int tableIndex = 123;
final ClassifyAddDelSession request =
- writer.createClassifySession(action, aceIp, InterfaceMode.L2, tableIndex, 0);
+ writer.createSession(action, aceIp, InterfaceMode.L2, tableIndex, 0);
verifySessionRequest(request, tableIndex, 0, true);
}
@@ -182,7 +177,7 @@ public class AceIp6WriterTest {
final int tableIndex = 123;
final int vlanTags = 1;
final ClassifyAddDelSession request =
- writer.createClassifySession(action, aceIp, InterfaceMode.L3, tableIndex, vlanTags);
+ writer.createSession(action, aceIp, InterfaceMode.L3, tableIndex, vlanTags);
verifySessionRequest(request, tableIndex, vlanTags, false);
}
@@ -191,15 +186,7 @@ public class AceIp6WriterTest {
final int tableIndex = 123;
final int vlanTags = 2;
final ClassifyAddDelSession request =
- writer.createClassifySession(action, aceIp, InterfaceMode.L3, tableIndex, vlanTags);
+ writer.createSession(action, aceIp, InterfaceMode.L3, tableIndex, vlanTags);
verifySessionRequest(request, tableIndex, vlanTags, false);
}
-
- @Test
- public void testSetClassifyTable() {
- final int tableIndex = 321;
- final InputAclSetInterface request = new InputAclSetInterface();
- writer.setClassifyTable(request, tableIndex);
- assertEquals(tableIndex, request.ip6TableIndex);
- }
} \ No newline at end of file
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIpAndEthWriterTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIpAndEthWriterTest.java
new file mode 100644
index 000000000..1da23072b
--- /dev/null
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIpAndEthWriterTest.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.fd.honeycomb.translate.v3po.interfaces.acl.ingress;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.MockitoAnnotations.initMocks;
+
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelSession;
+import io.fd.vpp.jvpp.core.dto.ClassifyAddDelTable;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.actions.PacketHandling;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.actions.packet.handling.DenyBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.acl.rev161214.InterfaceMode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.acl.rev161214.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIpAndEth;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.acl.rev161214.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIpAndEthBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.acl.rev161214.access.lists.acl.access.list.entries.ace.matches.ace.type.ace.ip.and.eth.ace.ip.version.AceIpv4Builder;
+
+public class AceIpAndEthWriterTest {
+
+ private AceIpAndEthWriter writer;
+ private PacketHandling action;
+ private AceIpAndEth ace;
+
+ @Before
+ public void setUp() {
+ initMocks(this);
+ writer = new AceIpAndEthWriter();
+ action = new DenyBuilder().setDeny(true).build();
+ ace = new AceIpAndEthBuilder()
+ .setDestinationMacAddress(new MacAddress("11:22:33:44:55:66"))
+ .setSourceMacAddress(new MacAddress("aa:bb:cc:dd:ee:ff"))
+ .setAceIpVersion(new AceIpv4Builder()
+ .setSourceIpv4Network(new Ipv4Prefix("1.2.3.4/32")).build())
+ .build();
+ }
+
+ @Test
+ public void testCreateTable() {
+ final int nextTableIndex = 42;
+ final ClassifyAddDelTable request = writer.createTable(ace, InterfaceMode.L2, nextTableIndex, 0);
+
+ assertEquals(1, request.isAdd);
+ assertEquals(-1, request.tableIndex);
+ assertEquals(1, request.nbuckets);
+ assertEquals(nextTableIndex, request.nextTableIndex);
+ assertEquals(0, request.skipNVectors);
+ assertEquals(3, request.matchNVectors);
+ assertEquals(AceEthWriter.TABLE_MEM_SIZE, request.memorySize);
+
+ byte[] expectedMask = new byte[] {
+ // destination MAC:
+ -1, -1, -1, -1, -1, -1,
+ // source MAC:
+ -1, -1, -1, -1, -1, -1,
+ // ether type:
+ -1, -1,
+ // IP header
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ // source address:
+ -1, -1, -1, -1,
+ // destination address:
+ 0, 0, 0, 0,
+ // padding:
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ assertArrayEquals(expectedMask, request.mask);
+ }
+
+ @Test
+ public void testCreateClassifySession() {
+ final int tableIndex = 123;
+ final ClassifyAddDelSession request = writer.createSession(action, ace, InterfaceMode.L2, tableIndex, 0);
+
+ assertEquals(1, request.isAdd);
+ assertEquals(tableIndex, request.tableIndex);
+ assertEquals(0, request.hitNextIndex);
+
+ byte[] expectedMatch = new byte[] {
+ // destination MAC:
+ (byte) 0x11, (byte) 0x22, (byte) 0x33, (byte) 0x44, (byte) 0x55, (byte) 0x66,
+ // source MAC:
+ (byte) 0xaa, (byte) 0xbb, (byte) 0xcc, (byte) 0xdd, (byte) 0xee, (byte) 0xff,
+ // ether type (IP4):
+ 0x08, 0,
+ // IP header
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ // source address:
+ 1, 2, 3, 4,
+ // destination address:
+ 0, 0, 0, 0,
+ // padding:
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ assertArrayEquals(expectedMatch, request.match);
+ }
+} \ No newline at end of file
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java
index 9e010d0f8..6c7eea8b1 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/IetfAclCustomizerTest.java
@@ -84,7 +84,7 @@ public class IetfAclCustomizerTest extends WriterCustomizerTest {
@Override
protected void setUp() {
- customizer = new IetfAclCustomizer(new IetfAClWriter(api), new NamingContext("prefix", IFC_TEST_INSTANCE));
+ customizer = new IetfAclCustomizer(new IetfAclWriter(api), new NamingContext("prefix", IFC_TEST_INSTANCE));
defineMapping(mappingContext, IF_NAME, IF_INDEX, IFC_TEST_INSTANCE);
acl = new IngressBuilder().setAccessLists(
new AccessListsBuilder().setAcl(
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizerTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizerTest.java
index 53b7ccf7e..76c681ca9 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizerTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/SubInterfaceIetfAclCustomizerTest.java
@@ -21,7 +21,6 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.google.common.base.Optional;
-import io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAclWriter;
import io.fd.honeycomb.translate.vpp.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.honeycomb.vpp.test.write.WriterCustomizerTest;
@@ -71,7 +70,7 @@ public class SubInterfaceIetfAclCustomizerTest extends WriterCustomizerTest {
@Override
protected void setUp() {
customizer =
- new SubInterfaceIetfAclCustomizer(new IetfAClWriter(api), new NamingContext("prefix", IFC_TEST_INSTANCE));
+ new SubInterfaceIetfAclCustomizer(new IetfAclWriter(api), new NamingContext("prefix", IFC_TEST_INSTANCE));
defineMapping(mappingContext, IF_NAME, IF_INDEX, IFC_TEST_INSTANCE);
acl = new IngressBuilder().setAccessLists(
@@ -134,7 +133,7 @@ public class SubInterfaceIetfAclCustomizerTest extends WriterCustomizerTest {
new SubInterfaceBuilder().build()
));
- when(writeContext.readAfter(IetfAclWriter.ACL_ID.child(
+ when(writeContext.readAfter(io.fd.honeycomb.translate.v3po.interfaces.acl.IetfAclWriter.ACL_ID.child(
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl.class,
new AclKey(ACL_NAME, ACL_TYPE)))).thenReturn(Optional.of(
new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.AclBuilder()