summaryrefslogtreecommitdiffstats
path: root/acl/acl-impl/src/test/java/io
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-01-17 17:57:26 +0100
committerJan Srnicek <jsrnicek@cisco.com>2017-01-18 12:51:19 +0000
commit90d286c396eee2555b9a98b0af7fce292fce4879 (patch)
tree9618fbfe800e4c98754c0659ed7401c588810476 /acl/acl-impl/src/test/java/io
parent75f8aa0f9a1ff45f1be500304fb156a13fb6e6ef (diff)
HONEYCOMB-330: fix acl tag handling
Acl tag in vpp's acl plugin is an ascii tag, so it should not be handled as hex string. Change-Id: I801d5b72a4c20f78246288ea63d914b0b9f3564b Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'acl/acl-impl/src/test/java/io')
-rw-r--r--acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/VppAclCustomizerTest.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/VppAclCustomizerTest.java b/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/VppAclCustomizerTest.java
index b4b4ef9ba..197b68626 100644
--- a/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/VppAclCustomizerTest.java
+++ b/acl/acl-impl/src/test/java/io/fd/hc2vpp/acl/write/VppAclCustomizerTest.java
@@ -38,6 +38,7 @@ import io.fd.vpp.jvpp.acl.dto.MacipAclAddReply;
import io.fd.vpp.jvpp.acl.future.FutureJVppAclFacade;
import io.fd.vpp.jvpp.acl.types.AclRule;
import io.fd.vpp.jvpp.acl.types.MacipAclRule;
+import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -99,7 +100,7 @@ public class VppAclCustomizerTest extends WriterCustomizerTest implements AclTes
final MacipAclAdd request = macipAclAddReplaceRequestCaptor.getValue();
assertEquals(1, request.count);
- assertTrue(Arrays.equals("macip-acl".getBytes(), request.tag));
+ assertEquals("macip-tag-value", new String(request.tag, StandardCharsets.US_ASCII));
final MacipAclRule rule = request.r[0];
@@ -268,7 +269,7 @@ public class VppAclCustomizerTest extends WriterCustomizerTest implements AclTes
final AclAddReplace request = aclAddReplaceRequestCaptor.getValue();
assertEquals(aclIndex, request.aclIndex);
assertEquals(1, request.count);
- assertTrue(Arrays.equals("standard-acl".getBytes(), request.tag));
+ assertEquals("udp-tag-value", new String(request.tag, StandardCharsets.US_ASCII));
final AclRule udpRule = request.r[0];
@@ -292,7 +293,7 @@ public class VppAclCustomizerTest extends WriterCustomizerTest implements AclTes
final AclAddReplace request = aclAddReplaceRequestCaptor.getValue();
assertEquals(aclIndex, request.aclIndex);
assertEquals(1, request.count);
- assertTrue(Arrays.equals("standard-acl".getBytes(), request.tag));
+ assertEquals("tcp-tag-value", new String(request.tag, StandardCharsets.US_ASCII));
final AclRule tcpRule = request.r[0];
@@ -316,7 +317,8 @@ public class VppAclCustomizerTest extends WriterCustomizerTest implements AclTes
final AclAddReplace request = aclAddReplaceRequestCaptor.getValue();
assertEquals(aclIndex, request.aclIndex);
assertEquals(1, request.count);
- assertTrue(Arrays.equals("standard-acl".getBytes(), request.tag));
+ assertEquals("icmp-v6-tag-value", new String(request.tag, StandardCharsets.US_ASCII));
+
final AclRule icmpv6Rule = request.r[0];
@@ -344,7 +346,7 @@ public class VppAclCustomizerTest extends WriterCustomizerTest implements AclTes
final AclAddReplace request = aclAddReplaceRequestCaptor.getValue();
assertEquals(aclIndex, request.aclIndex);
assertEquals(1, request.count);
- assertTrue(Arrays.equals("standard-acl".getBytes(), request.tag));
+ assertEquals("icmp-v4-tag-value", new String(request.tag, StandardCharsets.US_ASCII));
final AclRule icmpRule = request.r[0];