summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/test/java/io/fd
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-10-11 12:35:51 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-10-11 10:51:37 +0000
commit7fa476774566cce370c5a5e97b410746bc3b4484 (patch)
tree4a4f5cd88e12f1853f590c4386399c0486cd1ce1 /v3po/v3po2vpp/src/test/java/io/fd
parent11e154ab3e09464086cad06376a5da25430cf48b (diff)
HONEYCOMB-258: fix protocol field translation in ACEs
It was translated to version field, but should be to protocol/next header field. Change-Id: I0cf23fdd43246bcc559f61d97701c9153e9b3607 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test/java/io/fd')
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp4WriterTest.java30
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/interfaces/acl/ingress/AceIp6WriterTest.java16
2 files changed, 32 insertions, 14 deletions
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 69fcf8d8c..1a7045529 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
@@ -50,7 +50,7 @@ public class AceIp4WriterTest {
writer = new AceIp4Writer(jvpp);
action = new DenyBuilder().setDeny(true).build();
aceIp = new AceIpBuilder()
- .setProtocol((short) 4)
+ .setProtocol((short) 132)
.setDscp(new Dscp((short) 11))
.setAceIpVersion(new AceIpv4Builder()
.setSourceIpv4Network(new Ipv4Prefix("1.2.3.4/32"))
@@ -70,9 +70,17 @@ public class AceIp4WriterTest {
assertEquals(AceIp4Writer.TABLE_MEM_SIZE, request.memorySize);
byte[] expectedMask = new byte[] {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (byte) 0xf0, (byte) 0xfc,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1,
- -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ // L2:
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ // dscp:
+ (byte) 0x00, (byte) 0xfc,
+ // protocol:
+ 0, 0, 0, 0, 0, 0, 0, (byte) 0xff, 0, 0,
+ // source address:
+ -1, -1, -1, -1,
+ // destination address:
+ -1, -1, -1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
if (isL2) {
@@ -90,9 +98,17 @@ public class AceIp4WriterTest {
assertEquals(0, request.hitNextIndex);
byte[] expectedMatch = new byte[] {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (byte) 0x40, (byte) 0x2c,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 1, 2,
- 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ // L2:
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ // dscp:
+ 0, (byte) 0x2c,
+ // protocol (132):
+ 0, 0, 0, 0, 0, 0, 0, (byte) 132, 0, 0,
+ // source address:
+ 1, 2, 3, 4,
+ // destination address:
+ 1, 2, 4, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
if (isL2) {
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 dbb3bd5fe..01eaa454d 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
@@ -51,7 +51,7 @@ public class AceIp6WriterTest {
writer = new AceIp6Writer(jvpp);
action = new DenyBuilder().setDeny(true).build();
aceIp = new AceIpBuilder()
- .setProtocol((short) 6)
+ .setProtocol((short) 132)
.setDscp(new Dscp((short) 11))
.setAceIpVersion(new AceIpv6Builder()
.setFlowLabel(new Ipv6FlowLabel(123L))
@@ -75,9 +75,10 @@ public class AceIp6WriterTest {
byte[] expectedMask = new byte[] {
// L2:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- // version, dscp, flow:
- (byte) 0xff, (byte) 0xcf, (byte) 0xff, (byte) 0xff,
- 0, 0, 0, 0,
+ // dscp, flow:
+ (byte) 0x0f, (byte) 0xcf, (byte) 0xff, (byte) 0xff,
+ // protocol:
+ 0, 0, (byte) 0xff, 0,
// source address:
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
@@ -104,9 +105,10 @@ public class AceIp6WriterTest {
byte[] expectedMatch = new byte[] {
// L2:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- // version(6), dscp(11), flow(123):
- (byte) 0x62, (byte) 0xc0, (byte) 0x00, (byte) 0x7b,
- 0, 0, 0, 0,
+ // dscp(11), flow(123):
+ (byte) 0x02, (byte) 0xc0, (byte) 0x00, (byte) 0x7b,
+ // protocol (132):
+ 0, 0, (byte) 132, 0,
// source address:
(byte) 0x20, (byte) 0x01, (byte) 0x0d, (byte) 0xb8, (byte) 0x85, (byte) 0xa3, (byte) 0x08, (byte) 0xd3,
(byte) 0x13, (byte) 0x19, (byte) 0x8a, (byte) 0x2e, (byte) 0x03, (byte) 0x70, (byte) 0x73, (byte) 0x48,