summaryrefslogtreecommitdiffstats
path: root/routing/routing-impl
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-12-11 09:02:02 +0100
committerMarek Gradzki <mgradzki@cisco.com>2017-12-11 10:10:38 +0100
commit9e45c74fc1430342f84e5d63e842c7a093063613 (patch)
treee6dc2c63e621e4c68b7c52adbdadeb89e21cbefb /routing/routing-impl
parent1d3af1a3e8f1e51be846190a259cb03c60f7de3c (diff)
Do not use createVrfIfNeeded of IpAddDelRoute
It was not used by VPP, recently removed by: https://gerrit.fd.io/r/#/c/9771/ Change-Id: Ic838e4daf95a98d675b3f0fda6e5fad242eb5bbd Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'routing/routing-impl')
-rw-r--r--routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/trait/RouteRequestProducer.java3
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/helpers/RoutingRequestTestHelper.java7
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv4RouteCustomizerTest.java14
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java14
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/MultipathHopRequestFactoryIpv4Test.java6
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/MultipathHopRequestFactoryIpv6Test.java4
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/SimpleHopRequestFactoryIpv4Test.java6
-rw-r--r--routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/SimpleHopRequestFactoryIpv6Test.java6
8 files changed, 27 insertions, 33 deletions
diff --git a/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/trait/RouteRequestProducer.java b/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/trait/RouteRequestProducer.java
index 0b2c41179..80b4b8f79 100644
--- a/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/trait/RouteRequestProducer.java
+++ b/routing/routing-impl/src/main/java/io/fd/hc2vpp/routing/write/trait/RouteRequestProducer.java
@@ -125,9 +125,6 @@ public interface RouteRequestProducer extends ByteDataTranslator, AddressTransla
// vrf_id - fib table /vrf associated with the route Not mentioned in model
request.tableId = primaryVrf;
- // create vrf if needed needs to be turned on all the time,due to how we map table ids on routing protocols
- request.createVrfIfNeeded = 1;
-
// nextHopTableId - this is used when you want to have a second lookup done in another table.
request.nextHopTableId = secondaryVrf;
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/helpers/RoutingRequestTestHelper.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/helpers/RoutingRequestTestHelper.java
index dd6ba37d2..6ca6bdd8b 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/helpers/RoutingRequestTestHelper.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/helpers/RoutingRequestTestHelper.java
@@ -55,14 +55,13 @@ public interface RoutingRequestTestHelper extends ByteDataTranslator, FutureProd
final int nextHopIndex,
final int nextHopWeight,
final int vrfId,
- final int createVrfIfNeeded,
final int secondaryVrfId,
final int classifyTableIndex,
final int classifyTableIndexSet) {
// verification of flagless request, so setting them to 0
return desiredResult(add, ipv6, isMultipath, destinationAddress, destinationPrefixLength, nextHopAddr,
- nextHopIndex, nextHopWeight, vrfId, createVrfIfNeeded, secondaryVrfId, classifyTableIndex,
+ nextHopIndex, nextHopWeight, vrfId, secondaryVrfId, classifyTableIndex,
classifyTableIndexSet, 0, 0, 0, 0);
}
@@ -76,7 +75,7 @@ public interface RoutingRequestTestHelper extends ByteDataTranslator, FutureProd
final int protocolTableId,
final int secondaryTableId) {
// verifiaction of special request that has only destination address and flag
- return desiredResult(add, ipv6, 0, destinationAddress, destinationPrefixLength, null, 0, 0, protocolTableId, 1, secondaryTableId, 0, 0,
+ return desiredResult(add, ipv6, 0, destinationAddress, destinationPrefixLength, null, 0, 0, protocolTableId, secondaryTableId, 0, 0,
isDrop, isReceive, isUnreach, isProhibit);
}
@@ -87,7 +86,6 @@ public interface RoutingRequestTestHelper extends ByteDataTranslator, FutureProd
final int nextHopIndex,
final int nextHopWeight,
final int vrfId,
- final int createVrfIfNeeded,
final int secondaryVrfId,
final int classifyTableIndex,
final int classifyTableIndexSet,
@@ -108,7 +106,6 @@ public interface RoutingRequestTestHelper extends ByteDataTranslator, FutureProd
request.classifyTableIndex = classifyTableIndexSet;
request.tableId = vrfId;
request.nextHopTableId = secondaryVrfId;
- request.createVrfIfNeeded = (byte)createVrfIfNeeded;
request.classifyTableIndex = classifyTableIndex;
request.isClassify = (byte)classifyTableIndexSet;
// special hop flags
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv4RouteCustomizerTest.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv4RouteCustomizerTest.java
index 997857b54..b97658669 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv4RouteCustomizerTest.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv4RouteCustomizerTest.java
@@ -114,7 +114,7 @@ public class Ipv4RouteCustomizerTest extends WriterCustomizerTest
customizer.writeCurrentAttributes(validId, route1, writeContext);
verifyInvocation(1, ImmutableList
.of(desiredFlaglessResult(1, 0, 0, FIRST_ADDRESS_AS_ARRAY, 24,
- SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, ROUTE_PROTOCOL_INDEX, 1, 0,
+ SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, ROUTE_PROTOCOL_INDEX, 0,
CLASSIFY_TABLE_INDEX, 1)),
api, requestCaptor);
}
@@ -135,7 +135,7 @@ public class Ipv4RouteCustomizerTest extends WriterCustomizerTest
customizer.writeCurrentAttributes(validId, route, writeContext);
verifyInvocation(1, ImmutableList
.of(desiredFlaglessResult(1, 0, 0, FIRST_ADDRESS_AS_ARRAY, 24,
- new byte[4], ~0, 0, ROUTE_PROTOCOL_INDEX, 1, 4,
+ new byte[4], ~0, 0, ROUTE_PROTOCOL_INDEX, 4,
0, 0)),
api, requestCaptor);
}
@@ -151,10 +151,10 @@ public class Ipv4RouteCustomizerTest extends WriterCustomizerTest
verifyInvocation(2,
ImmutableList.of(
desiredFlaglessResult(1, 0, 1, FIRST_ADDRESS_AS_ARRAY, 24,
- FIRST_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, ROUTE_PROTOCOL_INDEX, 1, 0,
+ FIRST_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, ROUTE_PROTOCOL_INDEX, 0,
CLASSIFY_TABLE_INDEX, 1),
desiredFlaglessResult(1, 0, 1, FIRST_ADDRESS_AS_ARRAY, 24,
- SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 3, ROUTE_PROTOCOL_INDEX, 1, 0,
+ SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 3, ROUTE_PROTOCOL_INDEX, 0,
CLASSIFY_TABLE_INDEX, 1)), api,
requestCaptor);
@@ -206,7 +206,7 @@ public class Ipv4RouteCustomizerTest extends WriterCustomizerTest
verifyInvocation(1, ImmutableList
.of(desiredFlaglessResult(0, 0, 0, FIRST_ADDRESS_AS_ARRAY, 24,
SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX,
- 0, ROUTE_PROTOCOL_INDEX, 1, 0, CLASSIFY_TABLE_INDEX, 1)), api, requestCaptor);
+ 0, ROUTE_PROTOCOL_INDEX, 0, CLASSIFY_TABLE_INDEX, 1)), api, requestCaptor);
}
@Test
@@ -220,10 +220,10 @@ public class Ipv4RouteCustomizerTest extends WriterCustomizerTest
verifyInvocation(2,
ImmutableList.of(
desiredFlaglessResult(0, 0, 1, FIRST_ADDRESS_AS_ARRAY, 24,
- FIRST_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, ROUTE_PROTOCOL_INDEX, 1, 0,
+ FIRST_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, ROUTE_PROTOCOL_INDEX, 0,
CLASSIFY_TABLE_INDEX, 1),
desiredFlaglessResult(0, 0, 1, FIRST_ADDRESS_AS_ARRAY, 24,
- new byte[]{-64, -88, 2, 2}, INTERFACE_INDEX, 3, ROUTE_PROTOCOL_INDEX, 1, 0,
+ new byte[]{-64, -88, 2, 2}, INTERFACE_INDEX, 3, ROUTE_PROTOCOL_INDEX, 0,
CLASSIFY_TABLE_INDEX, 1)), api, requestCaptor);
verify(routeHopContext, times(1))
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java
index 7b9a7856a..a68fa57c4 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/Ipv6RouteCustomizerTest.java
@@ -107,7 +107,7 @@ public class Ipv6RouteCustomizerTest extends WriterCustomizerTest
verifyInvocation(1, ImmutableList
.of(desiredFlaglessResult(1, 1, 0, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, ROUTE_PROTOCOL_INDEX,
- 1, 0, CLASSIFY_TABLE_INDEX, 1)), api, requestCaptor);
+ 0, CLASSIFY_TABLE_INDEX, 1)), api, requestCaptor);
}
//TODO - https://jira.fd.io/browse/HONEYCOMB-396
@@ -127,7 +127,7 @@ public class Ipv6RouteCustomizerTest extends WriterCustomizerTest
customizer.writeCurrentAttributes(validId, route, writeContext);
verifyInvocation(1, ImmutableList
.of(desiredFlaglessResult(1, 1, 0, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 24,
- new byte[4], ~0, 0, ROUTE_PROTOCOL_INDEX, 1, 4,
+ new byte[4], ~0, 0, ROUTE_PROTOCOL_INDEX, 4,
0, 0)),
api, requestCaptor);
}
@@ -141,10 +141,10 @@ public class Ipv6RouteCustomizerTest extends WriterCustomizerTest
verifyInvocation(2,
ImmutableList.of(
desiredFlaglessResult(1, 1, 1, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
- Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, ROUTE_PROTOCOL_INDEX, 1, 0,
+ Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, ROUTE_PROTOCOL_INDEX, 0,
CLASSIFY_TABLE_INDEX, 1),
desiredFlaglessResult(1, 1, 1, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
- Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, ROUTE_PROTOCOL_INDEX, 1, 0,
+ Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, ROUTE_PROTOCOL_INDEX, 0,
CLASSIFY_TABLE_INDEX, 1)), api,
requestCaptor);
}
@@ -176,7 +176,7 @@ public class Ipv6RouteCustomizerTest extends WriterCustomizerTest
verifyInvocation(1, ImmutableList
.of(desiredFlaglessResult(0, 1, 0, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, 1,
- 1, 0, CLASSIFY_TABLE_INDEX, 1)), api, requestCaptor);
+ 0, CLASSIFY_TABLE_INDEX, 1)), api, requestCaptor);
}
@Test
@@ -188,10 +188,10 @@ public class Ipv6RouteCustomizerTest extends WriterCustomizerTest
verifyInvocation(2,
ImmutableList.of(
desiredFlaglessResult(0, 1, 1, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
- Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 1, 0,
+ Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 0,
CLASSIFY_TABLE_INDEX, 1),
desiredFlaglessResult(0, 1, 1, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
- Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 1, 0,
+ Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 0,
CLASSIFY_TABLE_INDEX, 1)), api,
requestCaptor);
}
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/MultipathHopRequestFactoryIpv4Test.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/MultipathHopRequestFactoryIpv4Test.java
index 99112f5ed..a17dfa3fb 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/MultipathHopRequestFactoryIpv4Test.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/MultipathHopRequestFactoryIpv4Test.java
@@ -115,7 +115,7 @@ public class MultipathHopRequestFactoryIpv4Test
mappingContext);
assertEquals(desiredFlaglessResult(0, 0, 1, Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, 24,
- Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 1, 0, CLASSIFY_TABLE_INDEX, 1), request);
+ Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 0, CLASSIFY_TABLE_INDEX, 1), request);
}
@Test
@@ -127,7 +127,7 @@ public class MultipathHopRequestFactoryIpv4Test
assertEquals(
desiredFlaglessResult(0, 0, 1, Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, 24,
- Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 1, 0, 0, 0), request);
+ Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 0, 0, 0), request);
}
@Test
@@ -139,6 +139,6 @@ public class MultipathHopRequestFactoryIpv4Test
assertEquals(
desiredFlaglessResult(0, 0, 1, Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, 24,
- Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 1, 0, 0, 0), request);
+ Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 0, 0, 0), request);
}
}
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/MultipathHopRequestFactoryIpv6Test.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/MultipathHopRequestFactoryIpv6Test.java
index 7c183dd61..50bd106ed 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/MultipathHopRequestFactoryIpv6Test.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/MultipathHopRequestFactoryIpv6Test.java
@@ -106,7 +106,7 @@ public class MultipathHopRequestFactoryIpv6Test
assertEquals(
desiredFlaglessResult(0, 1, 1, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
- Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 1, 0, CLASSIFY_TABLE_INDEX, 1),
+ Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 0, CLASSIFY_TABLE_INDEX, 1),
request);
}
@@ -119,7 +119,7 @@ public class MultipathHopRequestFactoryIpv6Test
assertEquals(
desiredFlaglessResult(0, 1, 1, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
- Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 1, 0, 0, 0), request);
+ Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 2, 1, 0, 0, 0), request);
}
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/SimpleHopRequestFactoryIpv4Test.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/SimpleHopRequestFactoryIpv4Test.java
index 6c7a9ec83..15951f48e 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/SimpleHopRequestFactoryIpv4Test.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/SimpleHopRequestFactoryIpv4Test.java
@@ -74,7 +74,7 @@ public class SimpleHopRequestFactoryIpv4Test
assertEquals(desiredFlaglessResult(0, 0, 0, Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, 24,
Ipv4RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0,
- 1, 1, 0, CLASSIFY_TABLE_INDEX, 1), request);
+ 1, 0, CLASSIFY_TABLE_INDEX, 1), request);
}
@Test
@@ -88,7 +88,7 @@ public class SimpleHopRequestFactoryIpv4Test
assertEquals(
desiredFlaglessResult(0, 0, 0, Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, 24,
- Ipv4RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, 1, 1, 0, 0, 0), request);
+ Ipv4RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, 1, 0, 0, 0), request);
}
@Test
@@ -102,6 +102,6 @@ public class SimpleHopRequestFactoryIpv4Test
assertEquals(
desiredFlaglessResult(0, 0, 0, Ipv4RouteData.FIRST_ADDRESS_AS_ARRAY, 24,
- Ipv4RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, 1, 1, 0, 0, 0), request);
+ Ipv4RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, 1, 0, 0, 0), request);
}
}
diff --git a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/SimpleHopRequestFactoryIpv6Test.java b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/SimpleHopRequestFactoryIpv6Test.java
index 6047aaf9f..c50a14ab4 100644
--- a/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/SimpleHopRequestFactoryIpv6Test.java
+++ b/routing/routing-impl/src/test/java/io/fd/hc2vpp/routing/write/factory/SimpleHopRequestFactoryIpv6Test.java
@@ -75,7 +75,7 @@ public class SimpleHopRequestFactoryIpv6Test
assertEquals(desiredFlaglessResult(0, 1, 0, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, 1,
- 1, 0, CLASSIFY_TABLE_INDEX, 1), request);
+ 0, CLASSIFY_TABLE_INDEX, 1), request);
}
@Test
@@ -89,7 +89,7 @@ public class SimpleHopRequestFactoryIpv6Test
mappingContext);
assertEquals(desiredFlaglessResult(0, 1, 0, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
- Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, 1, 1, 0, 0, 0), request);
+ Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, 1, 0, 0, 0), request);
}
@Test
@@ -102,6 +102,6 @@ public class SimpleHopRequestFactoryIpv6Test
mappingContext);
assertEquals(desiredFlaglessResult(0, 1, 0, Ipv6RouteData.FIRST_ADDRESS_AS_ARRAY, 64,
- Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, 1, 1, 0, 0, 0), request);
+ Ipv6RouteData.SECOND_ADDRESS_AS_ARRAY, INTERFACE_INDEX, 0, 1, 0, 0, 0), request);
}
}