diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2017-01-17 17:57:26 +0100 |
---|---|---|
committer | Jan Srnicek <jsrnicek@cisco.com> | 2017-01-18 12:51:19 +0000 |
commit | 90d286c396eee2555b9a98b0af7fce292fce4879 (patch) | |
tree | 9618fbfe800e4c98754c0659ed7401c588810476 /acl/acl-impl/src/test | |
parent | 75f8aa0f9a1ff45f1be500304fb156a13fb6e6ef (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')
6 files changed, 12 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]; diff --git a/acl/acl-impl/src/test/resources/acl/macip/macip-acl.json b/acl/acl-impl/src/test/resources/acl/macip/macip-acl.json index b944cd79c..40858f122 100644 --- a/acl/acl-impl/src/test/resources/acl/macip/macip-acl.json +++ b/acl/acl-impl/src/test/resources/acl/macip/macip-acl.json @@ -4,6 +4,7 @@ { "acl-name": "macip-acl", "acl-type": "vpp-acl:vpp-macip-acl", + "tag": "macip-tag-value", "access-list-entries": { "ace": [ { diff --git a/acl/acl-impl/src/test/resources/acl/standard/standard-acl-icmp-v6.json b/acl/acl-impl/src/test/resources/acl/standard/standard-acl-icmp-v6.json index 08bc61511..106432758 100644 --- a/acl/acl-impl/src/test/resources/acl/standard/standard-acl-icmp-v6.json +++ b/acl/acl-impl/src/test/resources/acl/standard/standard-acl-icmp-v6.json @@ -4,6 +4,7 @@ { "acl-name": "standard-acl", "acl-type": "vpp-acl:vpp-acl", + "tag": "icmp-v6-tag-value", "access-list-entries": { "ace": [ { diff --git a/acl/acl-impl/src/test/resources/acl/standard/standard-acl-icmp.json b/acl/acl-impl/src/test/resources/acl/standard/standard-acl-icmp.json index ce6ff7c2c..d278e1529 100644 --- a/acl/acl-impl/src/test/resources/acl/standard/standard-acl-icmp.json +++ b/acl/acl-impl/src/test/resources/acl/standard/standard-acl-icmp.json @@ -4,6 +4,7 @@ { "acl-name": "standard-acl", "acl-type": "vpp-acl:vpp-acl", + "tag": "icmp-v4-tag-value", "access-list-entries": { "ace": [ { diff --git a/acl/acl-impl/src/test/resources/acl/standard/standard-acl-tcp.json b/acl/acl-impl/src/test/resources/acl/standard/standard-acl-tcp.json index f0a1309aa..42d14ce0b 100644 --- a/acl/acl-impl/src/test/resources/acl/standard/standard-acl-tcp.json +++ b/acl/acl-impl/src/test/resources/acl/standard/standard-acl-tcp.json @@ -4,6 +4,7 @@ { "acl-name": "standard-acl", "acl-type": "vpp-acl:vpp-acl", + "tag": "tcp-tag-value", "access-list-entries": { "ace": [ { diff --git a/acl/acl-impl/src/test/resources/acl/standard/standard-acl-udp.json b/acl/acl-impl/src/test/resources/acl/standard/standard-acl-udp.json index 77dafeb21..5e945be40 100644 --- a/acl/acl-impl/src/test/resources/acl/standard/standard-acl-udp.json +++ b/acl/acl-impl/src/test/resources/acl/standard/standard-acl-udp.json @@ -4,6 +4,7 @@ { "acl-name": "standard-acl", "acl-type": "vpp-acl:vpp-acl", + "tag": "udp-tag-value", "access-list-entries": { "ace": [ { |