[AETHER-599] Implement FabricPipelineTraceable
Core changes supporting fabric traceable implementation.
Includes minor fixes to the OFDPA traceable unit tests
Change-Id: I2f0d1172022a8fc725df9e96526092c59ddc0e0b
diff --git a/core/api/src/main/java/org/onosproject/net/PipelineTraceableHitChain.java b/core/api/src/main/java/org/onosproject/net/PipelineTraceableHitChain.java
index 4eb26b5..6e5f566 100644
--- a/core/api/src/main/java/org/onosproject/net/PipelineTraceableHitChain.java
+++ b/core/api/src/main/java/org/onosproject/net/PipelineTraceableHitChain.java
@@ -17,7 +17,6 @@
package org.onosproject.net;
import com.google.common.collect.Lists;
-import org.onosproject.net.flow.TrafficSelector;
import java.util.List;
import java.util.Objects;
@@ -25,11 +24,11 @@
/**
* Class to represent the pipeline hit chain and the result of the pipeline processing.
*/
-public class PipelineTraceableHitChain {
+public final class PipelineTraceableHitChain {
private ConnectPoint outputPort;
private List<DataPlaneEntity> hitChain;
- private TrafficSelector egressPacket;
+ private PipelineTraceablePacket egressPacket;
// By default packets are dropped
private boolean dropped = true;
@@ -42,10 +41,10 @@
*
* @param output the output connect point
* @param hits the hits in the pipeline (flows, groups and other abstractions)
- * @param packet the selector representing the final packet
+ * @param packet the traceable packet representing the final packet
*/
public PipelineTraceableHitChain(ConnectPoint output, List<DataPlaneEntity> hits,
- TrafficSelector packet) {
+ PipelineTraceablePacket packet) {
this.outputPort = output;
this.hitChain = hits;
this.egressPacket = packet;
@@ -65,7 +64,7 @@
*
* @return the connect point
*/
- public ConnectPoint getOutputPort() {
+ public ConnectPoint outputPort() {
return outputPort;
}
@@ -83,7 +82,7 @@
*
* @return flows and groups that matched.
*/
- public List<DataPlaneEntity> getHitChain() {
+ public List<DataPlaneEntity> hitChain() {
return hitChain;
}
@@ -113,9 +112,9 @@
/**
* Returns the egress packet after traversing the pipeline.
*
- * @return the selector representing the packet infos
+ * @return the traceable packet representing the packet infos
*/
- public TrafficSelector getEgressPacket() {
+ public PipelineTraceablePacket egressPacket() {
return egressPacket;
}
@@ -124,7 +123,7 @@
*
* @param egressPacket the egress packet
*/
- public void setEgressPacket(TrafficSelector egressPacket) {
+ public void setEgressPacket(PipelineTraceablePacket egressPacket) {
this.egressPacket = egressPacket;
}
@@ -164,7 +163,7 @@
if (obj instanceof PipelineTraceableHitChain) {
PipelineTraceableHitChain that = (PipelineTraceableHitChain) obj;
return Objects.equals(this.outputPort, that.outputPort) &&
- Objects.equals(this.hitChain, that.getHitChain()) &&
+ Objects.equals(this.hitChain, that.hitChain) &&
Objects.equals(this.egressPacket, that.egressPacket) &&
Objects.equals(this.dropped, that.dropped);
}
diff --git a/core/api/src/main/java/org/onosproject/net/PipelineTraceableInput.java b/core/api/src/main/java/org/onosproject/net/PipelineTraceableInput.java
index 2403c5e..8df5d95 100644
--- a/core/api/src/main/java/org/onosproject/net/PipelineTraceableInput.java
+++ b/core/api/src/main/java/org/onosproject/net/PipelineTraceableInput.java
@@ -20,7 +20,6 @@
import com.google.common.collect.Maps;
import org.onosproject.core.GroupId;
import org.onosproject.net.flow.FlowEntry;
-import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.group.Group;
import java.util.List;
@@ -29,20 +28,29 @@
/**
* Represents the input of the pipeline traceable processing.
*/
-public class PipelineTraceableInput {
+public final class PipelineTraceableInput {
// Input state for the traceable behavior
- TrafficSelector ingressPacket;
- ConnectPoint ingressPort;
+ private PipelineTraceablePacket ingressPacket;
+ private ConnectPoint ingressPort;
// List here all possible device state using
// possibly an optimized reference
- List<FlowEntry> flows = Lists.newArrayList();
- Map<GroupId, Group> groups = Maps.newHashMap();
+ private List<FlowEntry> flows = Lists.newArrayList();
+ private Map<GroupId, Group> groups = Maps.newHashMap();
+ private List<DataPlaneEntity> deviceState;
- public PipelineTraceableInput(TrafficSelector ingressPacket, ConnectPoint ingressPort,
+ /**
+ * Builds a pipeline traceable input.
+ *
+ * @param ingressPacket the input packet
+ * @param ingressPort the input port
+ * @param deviceState the device state
+ */
+ public PipelineTraceableInput(PipelineTraceablePacket ingressPacket, ConnectPoint ingressPort,
List<DataPlaneEntity> deviceState) {
this.ingressPacket = ingressPacket;
this.ingressPort = ingressPort;
+ this.deviceState = deviceState;
processDeviceState(deviceState);
}
@@ -62,7 +70,7 @@
*
* @return the ingress packet
*/
- public TrafficSelector ingressPacket() {
+ public PipelineTraceablePacket ingressPacket() {
return ingressPacket;
}
@@ -76,6 +84,15 @@
}
/**
+ * Getter for the device state.
+ *
+ * @return the device state
+ */
+ public List<DataPlaneEntity> deviceState() {
+ return deviceState;
+ }
+
+ /**
* Getter for the flows.
*
* @return the flows
@@ -99,7 +116,7 @@
* @param groupId the group id
* @return the group, otherwise null.
*/
- public Group getGroup(GroupId groupId) {
+ public Group groupById(GroupId groupId) {
return groups.get(groupId);
}
diff --git a/core/api/src/main/java/org/onosproject/net/PipelineTraceableMetadata.java b/core/api/src/main/java/org/onosproject/net/PipelineTraceableMetadata.java
new file mode 100644
index 0000000..2c92afc
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/PipelineTraceableMetadata.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2020-present Open Networking Foundation
+ *
+ * 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 org.onosproject.net;
+
+/**
+ * Stores traceable processing metadata.
+ */
+public interface PipelineTraceableMetadata {
+
+}
diff --git a/core/api/src/main/java/org/onosproject/net/PipelineTraceableOutput.java b/core/api/src/main/java/org/onosproject/net/PipelineTraceableOutput.java
index 21a9819..66a18c0 100644
--- a/core/api/src/main/java/org/onosproject/net/PipelineTraceableOutput.java
+++ b/core/api/src/main/java/org/onosproject/net/PipelineTraceableOutput.java
@@ -74,7 +74,7 @@
*
* @return the log message
*/
- public String getLog() {
+ public String log() {
return log;
}
@@ -83,7 +83,7 @@
*
* @return the pipeline hit chains
*/
- public List<PipelineTraceableHitChain> getHitChains() {
+ public List<PipelineTraceableHitChain> hitChains() {
return hitChains;
}
@@ -92,7 +92,7 @@
*
* @return the pipeline traceable result
*/
- public PipelineTraceableResult getResult() {
+ public PipelineTraceableResult result() {
return result;
}
@@ -106,6 +106,16 @@
}
/**
+ * Returns a new builder initialized with the traceable output.
+ *
+ * @param pipelineTraceableOutput the output used for the initialization
+ * @return an initialized builder
+ */
+ public static PipelineTraceableOutput.Builder builder(PipelineTraceableOutput pipelineTraceableOutput) {
+ return new PipelineTraceableOutput.Builder(pipelineTraceableOutput);
+ }
+
+ /**
* Builder of pipeline traceable entities.
*/
public static final class Builder {
@@ -114,6 +124,15 @@
private List<PipelineTraceableHitChain> hitChains = Lists.newArrayList();
private PipelineTraceableResult result = PipelineTraceableResult.SUCCESS;
+ private Builder() {
+ }
+
+ private Builder(PipelineTraceableOutput traceableOutput) {
+ appendToLog("\n" + traceableOutput.log());
+ setResult(traceableOutput.result());
+ traceableOutput.hitChains().forEach(this::addHitChain);
+ }
+
/**
* Appends a message to the log.
*
@@ -128,7 +147,7 @@
return this;
}
- private Builder setResult(PipelineTraceableResult result) {
+ public Builder setResult(PipelineTraceableResult result) {
// Do not override original failure
if (this.result == PipelineTraceableResult.SUCCESS) {
this.result = result;
diff --git a/core/api/src/main/java/org/onosproject/net/PipelineTraceablePacket.java b/core/api/src/main/java/org/onosproject/net/PipelineTraceablePacket.java
new file mode 100644
index 0000000..ffa2063
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/PipelineTraceablePacket.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2020-present Open Networking Foundation
+ *
+ * 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 org.onosproject.net;
+
+import org.onosproject.net.flow.TrafficSelector;
+
+import java.util.Objects;
+
+/**
+ * Represents a traceable packet composed by a traffic selector and metadata.
+ */
+public final class PipelineTraceablePacket {
+
+ // stores metadata associated with the packet
+ private PipelineTraceableMetadata metadata;
+ // representation of the packet
+ private TrafficSelector packet;
+
+ /**
+ * Builds a traceable packet without metadata.
+ * Note this can be used for legacy device like ofdpa.
+ *
+ * @param packet the packet selector
+ */
+ public PipelineTraceablePacket(TrafficSelector packet) {
+ this.packet = packet;
+ }
+
+ /**
+ * Builds a traceable packet with metadata.
+ * @param packet the packet selector
+ * @param metadata the packet metadata
+ */
+ public PipelineTraceablePacket(TrafficSelector packet, PipelineTraceableMetadata metadata) {
+ this.packet = packet;
+ this.metadata = metadata;
+ }
+
+ /**
+ * Getter for the metadata.
+ *
+ * @return the packet metadata
+ */
+ public PipelineTraceableMetadata metadata() {
+ return metadata;
+ }
+
+ /**
+ * Getter for the packet selector.
+ *
+ * @return the packet selector
+ */
+ public TrafficSelector packet() {
+ return packet;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(metadata, packet);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof PipelineTraceablePacket) {
+ PipelineTraceablePacket that = (PipelineTraceablePacket) obj;
+ return Objects.equals(this.metadata, that.metadata) &&
+ Objects.equals(this.packet, that.packet);
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "PipelineTraceablePacket{" +
+ "metadata=" + metadata +
+ ", packet=" + packet +
+ '}';
+ }
+}
diff --git a/core/api/src/main/java/org/onosproject/net/flow/criteria/PiCriterion.java b/core/api/src/main/java/org/onosproject/net/flow/criteria/PiCriterion.java
index a346927..17d1270 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/criteria/PiCriterion.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/criteria/PiCriterion.java
@@ -108,6 +108,16 @@
}
/**
+ * Returns the PiCriterion builder initialized by the given PiCriterion.
+ *
+ * @param piCriterion the input PiCriterion
+ * @return PiCriterion builder
+ */
+ public static Builder builder(PiCriterion piCriterion) {
+ return new Builder(piCriterion);
+ }
+
+ /**
* PiCriterion Builder.
*/
@Beta
@@ -120,6 +130,21 @@
// ban constructor.
}
+ private Builder(PiCriterion piCriterion) {
+ piCriterion.fieldMatchMap.forEach(((piMatchFieldId, piFieldMatch) -> add(piFieldMatch)));
+ }
+
+ /**
+ * Adds a match field to the builder.
+ *
+ * @param field the field value
+ * @return this
+ */
+ public Builder add(PiFieldMatch field) {
+ fieldMatchMapBuilder.put(field.fieldId(), field);
+ return this;
+ }
+
/**
* Adds an exact field match for the given fieldId and value.
*
diff --git a/drivers/default/src/main/java/org/onosproject/driver/traceable/OfdpaPipelineTraceable.java b/drivers/default/src/main/java/org/onosproject/driver/traceable/OfdpaPipelineTraceable.java
index c269022..fa6a231 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/traceable/OfdpaPipelineTraceable.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/traceable/OfdpaPipelineTraceable.java
@@ -30,6 +30,7 @@
import org.onosproject.net.DataPlaneEntity;
import org.onosproject.net.PipelineTraceableInput;
import org.onosproject.net.PipelineTraceableOutput;
+import org.onosproject.net.PipelineTraceablePacket;
import org.onosproject.net.PortNumber;
import org.onosproject.net.behaviour.PipelineTraceable;
import org.onosproject.net.behaviour.Pipeliner;
@@ -106,13 +107,14 @@
List<FlowEntry> outputFlows = new ArrayList<>();
List<Instruction> deferredInstructions = new ArrayList<>();
PipelineTraceableHitChain currentHitChain = PipelineTraceableHitChain.emptyHitChain();
- TrafficSelector currentPacket = DefaultTrafficSelector.builder(input.ingressPacket()).build();
+ TrafficSelector currentPacket = DefaultTrafficSelector.builder(
+ input.ingressPacket().packet()).build();
// Init step - find out the first table
int initialTableId = -1;
FlowEntry nextTableIdEntry = findNextTableIdEntry(initialTableId, input.flows());
if (nextTableIdEntry == null) {
- currentHitChain.setEgressPacket(currentPacket);
+ currentHitChain.setEgressPacket(new PipelineTraceablePacket(currentPacket));
currentHitChain.dropped();
return outputBuilder.appendToLog("No flow rules for device " + deviceId + ". Aborting")
.noFlows()
@@ -137,7 +139,7 @@
if (((IndexTableId) tableId).id() == MPLS_L3_TYPE_TABLE) {
// Apparently a miss but Table 27 on OFDPA is a fixed table
- currentPacket = handleOfdpa27FixedTable(input.ingressPacket(), currentPacket);
+ currentPacket = handleOfdpa27FixedTable(input.ingressPacket().packet(), currentPacket);
// The nextTable should be ACL
tableId = IndexTableId.of(ACL_TABLE - 1);
}
@@ -147,8 +149,8 @@
log.debug("Next table id entry {}", nextTableIdEntry);
// FIXME Find better solution that enable granularity greater than 0 or all rules
// (another possibility is max tableId)
- if (nextTableIdEntry == null && currentHitChain.getHitChain().size() == 0) {
- currentHitChain.setEgressPacket(currentPacket);
+ if (nextTableIdEntry == null && currentHitChain.hitChain().size() == 0) {
+ currentHitChain.setEgressPacket(new PipelineTraceablePacket(currentPacket));
currentHitChain.dropped();
return outputBuilder.appendToLog("No flow rules for device " + deviceId + ". Aborting")
.noFlows()
@@ -173,7 +175,7 @@
}
} else if (flowEntry == null) {
- currentHitChain.setEgressPacket(currentPacket);
+ currentHitChain.setEgressPacket(new PipelineTraceablePacket(currentPacket));
currentHitChain.dropped();
return outputBuilder.appendToLog("Packet has no match on table " + tableId
+ " in device " + deviceId + ". Dropping")
@@ -231,7 +233,7 @@
if (secondVlanFlow != null) {
currentHitChain.addDataPlaneEntity(new DataPlaneEntity(secondVlanFlow));
} else {
- currentHitChain.setEgressPacket(currentPacket);
+ currentHitChain.setEgressPacket(new PipelineTraceablePacket(currentPacket));
currentHitChain.dropped();
return outputBuilder.appendToLog("Missing forwarding rule for tagged"
+ " packet on " + deviceId)
@@ -253,16 +255,16 @@
// need to reflect the updates performed on the packets and on the chain.
List<PortNumber> outputPorts = new ArrayList<>();
handleOutputFlows(currentPacket, outputFlows, egressPacket, outputPorts, currentHitChain,
- outputBuilder, input.ingressPacket());
+ outputBuilder, input.ingressPacket().packet());
// Immediate instructions
log.debug("Current packet {} - applying immediate instructions", currentPacket);
// Handling immediate instructions which basically means handling output to controller.
// OVS has immediate -> group -> OUTPUT:CONTROLLER.
- List<DataPlaneEntity> entries = ImmutableList.copyOf(currentHitChain.getHitChain());
+ List<DataPlaneEntity> entries = ImmutableList.copyOf(currentHitChain.hitChain());
// Go to the next step - using a copy of the egress packet and of the hit chain
PipelineTraceableHitChain newHitChain = PipelineTraceableHitChain.emptyHitChain();
- currentHitChain.getHitChain().forEach(newHitChain::addDataPlaneEntity);
+ currentHitChain.hitChain().forEach(newHitChain::addDataPlaneEntity);
TrafficSelector.Builder newEgressPacket = DefaultTrafficSelector.builder(egressPacket.build());
for (DataPlaneEntity entry : entries) {
flowEntry = entry.getFlowEntry();
@@ -286,7 +288,7 @@
// If there are no outputs - packet is dropped
// Let's store the partial hit chain and set a message
if (outputPorts.isEmpty()) {
- currentHitChain.setEgressPacket(egressPacket.build());
+ currentHitChain.setEgressPacket(new PipelineTraceablePacket(egressPacket.build()));
currentHitChain.dropped();
outputBuilder.appendToLog("Packet has no output in device " + deviceId + ". Dropping")
.dropped()
@@ -563,8 +565,8 @@
// Create the final hit chain from the current one (deep copy)
ConnectPoint outputPort = new ConnectPoint(deviceId, outputInstruction.port());
PipelineTraceableHitChain finalHitChain = new PipelineTraceableHitChain(outputPort,
- Lists.newArrayList(currentHitChain.getHitChain()),
- egressPacket.build());
+ Lists.newArrayList(currentHitChain.hitChain()),
+ new PipelineTraceablePacket(egressPacket.build()));
// Dropped early
if (dropped) {
log.debug("Packet {} has been dropped", egressPacket.build());
@@ -585,11 +587,12 @@
VlanIdCriterion initialVid = (VlanIdCriterion) initialPacket
.getCriterion(Criterion.Type.VLAN_VID);
- VlanIdCriterion finalVid = (VlanIdCriterion) currentHitChain.getEgressPacket()
+ VlanIdCriterion finalVid = (VlanIdCriterion) currentHitChain.egressPacket().packet()
.getCriterion(Criterion.Type.VLAN_VID);
if (initialVid != null && !initialVid.equals(finalVid) && initialVid.vlanId().equals(VlanId.NONE)) {
- Set<Criterion> finalCriteria = new HashSet<>(currentHitChain.getEgressPacket().criteria());
+ Set<Criterion> finalCriteria = new HashSet<>(currentHitChain.egressPacket()
+ .packet().criteria());
//removing the final vlanId
finalCriteria.remove(finalVid);
TrafficSelector.Builder packetUpdated = DefaultTrafficSelector.builder();
@@ -597,7 +600,7 @@
//Initial was none so we set it to that
packetUpdated.add(Criteria.matchVlanId(VlanId.NONE));
//Update final packet
- currentHitChain.setEgressPacket(packetUpdated.build());
+ currentHitChain.setEgressPacket(new PipelineTraceablePacket(packetUpdated.build()));
}
}
@@ -628,7 +631,7 @@
// or add the output to the possible outputs for this packet
if (instruction.type().equals(Instruction.Type.OUTPUT)) {
buildOutputFromDevice(egressPacket, outputPorts, (OutputInstruction) instruction,
- currentHitChain, outputBuilder, input.ingressPacket(), dropped);
+ currentHitChain, outputBuilder, input.ingressPacket().packet(), dropped);
} else {
egressPacket = translateInstruction(egressPacket, instruction);
}
@@ -645,7 +648,7 @@
// group does not exist in the dataplane
if (group == null) {
- currentHitChain.setEgressPacket(egressPacket.build());
+ currentHitChain.setEgressPacket(new PipelineTraceablePacket(egressPacket.build()));
currentHitChain.dropped();
outputBuilder.appendToLog("Null group for Instruction " + instr)
.noGroups()
@@ -659,7 +662,7 @@
if (group.buckets().buckets().size() == 0) {
// add the group to the traversed groups
currentHitChain.addDataPlaneEntity(new DataPlaneEntity(group));
- currentHitChain.setEgressPacket(egressPacket.build());
+ currentHitChain.setEgressPacket(new PipelineTraceablePacket(egressPacket.build()));
currentHitChain.dropped();
outputBuilder.appendToLog("Group " + group.id() + " has no buckets")
.noMembers()
@@ -677,7 +680,7 @@
// Go to the next step - using a copy of the egress packet and of the hit chain
newHitChain = PipelineTraceableHitChain.emptyHitChain();
- currentHitChain.getHitChain().forEach(newHitChain::addDataPlaneEntity);
+ currentHitChain.hitChain().forEach(newHitChain::addDataPlaneEntity);
newEgressPacket = DefaultTrafficSelector.builder(egressPacket.build());
getGroupsFromInstructions(groups, bucket.treatment().allInstructions(), newEgressPacket,
outputPorts, newHitChain, outputBuilder, input,
@@ -733,7 +736,7 @@
// of the egress packet and of the current hit chain.
if (outputFlowInstruction.size() == 1) {
buildOutputFromDevice(newEgressPacket, outputPorts, (OutputInstruction) outputFlowInstruction.get(0),
- currentHitChain, outputBuilder, input.ingressPacket(), false);
+ currentHitChain, outputBuilder, input.ingressPacket().packet(), false);
}
// If there is no output let's see if there any deferred instruction point to groups.
diff --git a/drivers/default/src/test/java/org/onosproject/driver/traceable/OfdpaPipelineTraceableTest.java b/drivers/default/src/test/java/org/onosproject/driver/traceable/OfdpaPipelineTraceableTest.java
index 49cb15a..2d77212 100644
--- a/drivers/default/src/test/java/org/onosproject/driver/traceable/OfdpaPipelineTraceableTest.java
+++ b/drivers/default/src/test/java/org/onosproject/driver/traceable/OfdpaPipelineTraceableTest.java
@@ -26,6 +26,7 @@
import org.onosproject.net.PipelineTraceableInput;
import org.onosproject.net.PipelineTraceableOutput;
import org.onosproject.net.PipelineTraceableOutput.PipelineTraceableResult;
+import org.onosproject.net.PipelineTraceablePacket;
import org.onosproject.net.PortNumber;
import org.onosproject.net.behaviour.PipelineTraceable;
import org.onosproject.net.behaviour.Pipeliner;
@@ -139,26 +140,26 @@
*/
@Test
public void testOvsOfdpaPuntIP() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_PUNT_IP_PACKET, OFDPA_CP,
- getDataPlaneEntities(OVS_OFDPA_DRIVER, PUNT_IP_OVS_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_PUNT_IP_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, PUNT_IP_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(PUNT_IP_OVS_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(PortNumber.CONTROLLER));
- assertThat(hitChain.getHitChain().size(), is(7));
- assertEquals(IN_PUNT_IP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(PortNumber.CONTROLLER));
+ assertThat(hitChain.hitChain().size(), is(7));
+ assertEquals(IN_PUNT_IP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -166,26 +167,26 @@
*/
@Test
public void testOfdpaPuntIP() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_PUNT_IP_PACKET, OFDPA_CP,
- getDataPlaneEntities(OFDPA_DRIVER, PUNT_IP_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_PUNT_IP_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, PUNT_IP_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(PUNT_IP_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(PortNumber.CONTROLLER));
- assertThat(hitChain.getHitChain().size(), is(4));
- assertEquals(IN_PUNT_IP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(PortNumber.CONTROLLER));
+ assertThat(hitChain.hitChain().size(), is(4));
+ assertEquals(IN_PUNT_IP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -193,49 +194,49 @@
*/
@Test
public void testOvsOfdpaArp() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_ARP_PACKET, OFDPA_CP,
- getDataPlaneEntities(OVS_OFDPA_DRIVER, ARP_OVS_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_ARP_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, ARP_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(3));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(3));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(ARP_OVS_OFDPA);
assertThat(chains.size(), is(3));
// This is the copy sent to the controller
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(PortNumber.CONTROLLER));
- assertThat(hitChain.getHitChain().size(), is(7));
- assertEquals(IN_ARP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(PortNumber.CONTROLLER));
+ assertThat(hitChain.hitChain().size(), is(7));
+ assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
// This is the copy sent to the member port
- hitChain = pipelineOutput.getHitChains().get(1);
+ hitChain = pipelineOutput.hitChains().get(1);
assertNotNull(hitChain);
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(OUT_PORT));
- assertThat(hitChain.getHitChain().size(), is(8));
- assertEquals(IN_ARP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(OUT_PORT));
+ assertThat(hitChain.hitChain().size(), is(8));
+ assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(1), hitChain.getHitChain());
+ assertEquals(chains.get(1), hitChain.hitChain());
// This is the copy sent on the input port
- hitChain = pipelineOutput.getHitChains().get(2);
+ hitChain = pipelineOutput.hitChains().get(2);
assertNotNull(hitChain);
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(PORT));
- assertThat(hitChain.getHitChain().size(), is(8));
- assertEquals(IN_ARP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(PORT));
+ assertThat(hitChain.hitChain().size(), is(8));
+ assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertTrue(hitChain.isDropped());
- assertEquals(chains.get(2), hitChain.getHitChain());
+ assertEquals(chains.get(2), hitChain.hitChain());
}
/**
@@ -243,47 +244,47 @@
*/
@Test
public void testOfdpaArp() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_ARP_PACKET, OFDPA_CP,
- getDataPlaneEntities(OFDPA_DRIVER, ARP_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_ARP_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, ARP_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(3));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(3));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(ARP_OFDPA);
assertThat(chains.size(), is(3));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(PortNumber.CONTROLLER));
- assertThat(hitChain.getHitChain().size(), is(4));
- assertEquals(IN_ARP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(PortNumber.CONTROLLER));
+ assertThat(hitChain.hitChain().size(), is(4));
+ assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
- hitChain = pipelineOutput.getHitChains().get(1);
+ hitChain = pipelineOutput.hitChains().get(1);
assertNotNull(hitChain);
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(OUT_PORT));
- assertThat(hitChain.getHitChain().size(), is(6));
- assertEquals(IN_ARP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(OUT_PORT));
+ assertThat(hitChain.hitChain().size(), is(6));
+ assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(1), hitChain.getHitChain());
+ assertEquals(chains.get(1), hitChain.hitChain());
- hitChain = pipelineOutput.getHitChains().get(2);
+ hitChain = pipelineOutput.hitChains().get(2);
assertNotNull(hitChain);
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(PORT));
- assertThat(hitChain.getHitChain().size(), is(6));
- assertEquals(IN_ARP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(PORT));
+ assertThat(hitChain.hitChain().size(), is(6));
+ assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertTrue(hitChain.isDropped());
- assertEquals(chains.get(2), hitChain.getHitChain());
+ assertEquals(chains.get(2), hitChain.hitChain());
}
/**
@@ -291,26 +292,26 @@
*/
@Test
public void testOvsOfdpaPuntLldp() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_PUNT_LLDP_PACKET, OFDPA_CP,
- getDataPlaneEntities(OVS_OFDPA_DRIVER, PUNT_LLDP_OVS_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_PUNT_LLDP_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, PUNT_LLDP_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(PUNT_LLDP_OVS_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(PortNumber.CONTROLLER));
- assertThat(hitChain.getHitChain().size(), is(7));
- assertEquals(IN_PUNT_LLDP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(PortNumber.CONTROLLER));
+ assertThat(hitChain.hitChain().size(), is(7));
+ assertEquals(IN_PUNT_LLDP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -318,26 +319,26 @@
*/
@Test
public void testOfdpaPuntLldp() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_PUNT_LLDP_PACKET, OFDPA_CP,
- getDataPlaneEntities(OFDPA_DRIVER, PUNT_LLDP_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_PUNT_LLDP_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, PUNT_LLDP_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(PUNT_LLDP_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(PortNumber.CONTROLLER));
- assertThat(hitChain.getHitChain().size(), is(4));
- assertEquals(IN_PUNT_LLDP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(PortNumber.CONTROLLER));
+ assertThat(hitChain.hitChain().size(), is(4));
+ assertEquals(IN_PUNT_LLDP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -345,26 +346,26 @@
*/
@Test
public void testOvsOfdpaL2BridingUntagged() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L2_BRIDG_UNTAG_PACKET, OFDPA_CP,
- getDataPlaneEntities(OVS_OFDPA_DRIVER, L2_BRIDG_UNTAG_OVS_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L2_BRIDG_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, L2_BRIDG_UNTAG_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L2_BRIDG_UNTAG_OVS_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(OUT_PORT));
- assertThat(hitChain.getHitChain().size(), is(6));
- assertEquals(IN_L2_BRIDG_UNTAG_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(OUT_PORT));
+ assertThat(hitChain.hitChain().size(), is(6));
+ assertEquals(IN_L2_BRIDG_UNTAG_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -372,26 +373,26 @@
*/
@Test
public void testOfdpaL2BridingUntagged() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L2_BRIDG_UNTAG_PACKET, OFDPA_CP,
- getDataPlaneEntities(OFDPA_DRIVER, L2_BRIDG_UNTAG_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L2_BRIDG_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, L2_BRIDG_UNTAG_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L2_BRIDG_UNTAG_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(OUT_PORT));
- assertThat(hitChain.getHitChain().size(), is(4));
- assertEquals(IN_L2_BRIDG_UNTAG_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(OUT_PORT));
+ assertThat(hitChain.hitChain().size(), is(4));
+ assertEquals(IN_L2_BRIDG_UNTAG_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -399,37 +400,37 @@
*/
@Test
public void testOvsOfdpaL2BroadcastUntagged() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L2_BROAD_UNTAG_PACKET, OFDPA_CP,
- getDataPlaneEntities(OVS_OFDPA_DRIVER, L2_BROAD_UNTAG_OVS_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L2_BROAD_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, L2_BROAD_UNTAG_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(2));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(2));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L2_BROAD_UNTAG_OVS_OFDPA);
assertThat(chains.size(), is(2));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(OUT_PORT));
- assertThat(hitChain.getHitChain().size(), is(7));
- assertEquals(IN_L2_BROAD_UNTAG_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(OUT_PORT));
+ assertThat(hitChain.hitChain().size(), is(7));
+ assertEquals(IN_L2_BROAD_UNTAG_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
// Dropped chain - input port!
- hitChain = pipelineOutput.getHitChains().get(1);
+ hitChain = pipelineOutput.hitChains().get(1);
assertNotNull(hitChain);
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(PORT));
- assertThat(hitChain.getHitChain().size(), is(7));
- assertEquals(IN_L2_BROAD_UNTAG_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(PORT));
+ assertThat(hitChain.hitChain().size(), is(7));
+ assertEquals(IN_L2_BROAD_UNTAG_PACKET, hitChain.egressPacket().packet());
assertTrue(hitChain.isDropped());
- assertEquals(chains.get(1), hitChain.getHitChain());
+ assertEquals(chains.get(1), hitChain.hitChain());
}
/**
@@ -437,37 +438,37 @@
*/
@Test
public void testOfdpaL2BroadcastUntagged() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L2_BROAD_UNTAG_PACKET, OFDPA_CP,
- getDataPlaneEntities(OFDPA_DRIVER, L2_BROAD_UNTAG_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L2_BROAD_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, L2_BROAD_UNTAG_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(2));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(2));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L2_BROAD_UNTAG_OFDPA);
assertThat(chains.size(), is(2));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(OUT_PORT));
- assertThat(hitChain.getHitChain().size(), is(5));
- assertEquals(IN_L2_BROAD_UNTAG_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(OUT_PORT));
+ assertThat(hitChain.hitChain().size(), is(5));
+ assertEquals(IN_L2_BROAD_UNTAG_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
// Dropped chain - input port!
- hitChain = pipelineOutput.getHitChains().get(1);
+ hitChain = pipelineOutput.hitChains().get(1);
assertNotNull(hitChain);
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(PORT));
- assertThat(hitChain.getHitChain().size(), is(5));
- assertEquals(IN_L2_BROAD_UNTAG_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(PORT));
+ assertThat(hitChain.hitChain().size(), is(5));
+ assertEquals(IN_L2_BROAD_UNTAG_PACKET, hitChain.egressPacket().packet());
assertTrue(hitChain.isDropped());
- assertEquals(chains.get(1), hitChain.getHitChain());
+ assertEquals(chains.get(1), hitChain.hitChain());
}
/**
@@ -475,27 +476,28 @@
*/
@Test
public void testOvsOfdpaL3Unicast() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L3_UCAST_UNTAG_PACKET, UP_OFDPA_CP,
- getDataPlaneEntities(OVS_OFDPA_DRIVER, L3_UCAST_UNTAG_OVS_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L3_UCAST_UNTAG_PACKET), UP_OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER,
+ L3_UCAST_UNTAG_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L3_UCAST_UNTAG_OVS_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(OUT_PORT));
- assertThat(hitChain.getHitChain().size(), is(7));
- assertEquals(OUT_L3_UCAST_UNTAG_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(OUT_PORT));
+ assertThat(hitChain.hitChain().size(), is(7));
+ assertEquals(OUT_L3_UCAST_UNTAG_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -503,27 +505,27 @@
*/
@Test
public void testOfdpaL3Unicast() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L3_UCAST_UNTAG_PACKET, UP_OFDPA_CP,
- getDataPlaneEntities(OFDPA_DRIVER, L3_UCAST_UNTAG_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L3_UCAST_UNTAG_PACKET), UP_OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, L3_UCAST_UNTAG_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L3_UCAST_UNTAG_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(OUT_PORT));
- assertThat(hitChain.getHitChain().size(), is(6));
- assertEquals(OUT_L3_UCAST_UNTAG_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(OUT_PORT));
+ assertThat(hitChain.hitChain().size(), is(6));
+ assertEquals(OUT_L3_UCAST_UNTAG_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -531,38 +533,38 @@
*/
@Test
public void testOvsOfdpaL3Ecmp() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L3_ECMP_PACKET, OFDPA_CP,
- getDataPlaneEntities(OVS_OFDPA_DRIVER, L3_ECMP_OVS_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L3_ECMP_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, L3_ECMP_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(2));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(2));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L3_ECMP_OVS_OFDPA);
assertThat(chains.size(), is(2));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(UP_PORT));
- assertThat(hitChain.getHitChain().size(), is(9));
- assertEquals(OUT_L3_ECMP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(UP_PORT));
+ assertThat(hitChain.hitChain().size(), is(9));
+ assertEquals(OUT_L3_ECMP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
// 2nd spine!
- hitChain = pipelineOutput.getHitChains().get(1);
+ hitChain = pipelineOutput.hitChains().get(1);
assertNotNull(hitChain);
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(UP_PORT_1));
- assertThat(hitChain.getHitChain().size(), is(9));
- assertEquals(OUT_L3_ECMP_PACKET_1, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(UP_PORT_1));
+ assertThat(hitChain.hitChain().size(), is(9));
+ assertEquals(OUT_L3_ECMP_PACKET_1, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(1), hitChain.getHitChain());
+ assertEquals(chains.get(1), hitChain.hitChain());
}
/**
@@ -570,37 +572,37 @@
*/
@Test
public void testOfdpaL3Ecmp() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L3_ECMP_PACKET, OFDPA_CP,
- getDataPlaneEntities(OFDPA_DRIVER, L3_ECMP_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L3_ECMP_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, L3_ECMP_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(2));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(2));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L3_ECMP_OFDPA);
assertThat(chains.size(), is(2));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(UP_PORT));
- assertThat(hitChain.getHitChain().size(), is(8));
- assertEquals(OUT_L3_ECMP_PACKET_OFDPA, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(UP_PORT));
+ assertThat(hitChain.hitChain().size(), is(8));
+ assertEquals(OUT_L3_ECMP_PACKET_OFDPA, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
- hitChain = pipelineOutput.getHitChains().get(1);
+ hitChain = pipelineOutput.hitChains().get(1);
assertNotNull(hitChain);
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(UP_PORT_1));
- assertThat(hitChain.getHitChain().size(), is(8));
- assertEquals(OUT_L3_ECMP_PACKET_OFDPA_1, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(UP_PORT_1));
+ assertThat(hitChain.hitChain().size(), is(8));
+ assertEquals(OUT_L3_ECMP_PACKET_OFDPA_1, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(1), hitChain.getHitChain());
+ assertEquals(chains.get(1), hitChain.hitChain());
}
/**
@@ -608,27 +610,28 @@
*/
@Test
public void testOvsOfdpaMplsEcmp() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_MPLS_ECMP_PACKET, UP_OFDPA_CP,
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_MPLS_ECMP_PACKET), UP_OFDPA_CP,
getDataPlaneEntities(OVS_OFDPA_DRIVER, MPLS_ECMP_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(MPLS_ECMP_OVS_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(UP_PORT_1));
- assertThat(hitChain.getHitChain().size(), is(9));
- assertEquals(OUT_MPLS_ECMP_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(UP_PORT_1));
+ assertThat(hitChain.hitChain().size(), is(9));
+ assertEquals(OUT_MPLS_ECMP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -636,27 +639,27 @@
*/
@Test
public void testOfdpaMplsEcmp() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_MPLS_ECMP_PACKET_OFDPA, OFDPA_CP,
- getDataPlaneEntities(OFDPA_DRIVER, MPLS_ECMP_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_MPLS_ECMP_PACKET_OFDPA), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, MPLS_ECMP_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(MPLS_ECMP_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(UP_PORT_1));
- assertThat(hitChain.getHitChain().size(), is(7));
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(UP_PORT_1));
+ assertThat(hitChain.hitChain().size(), is(7));
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
- assertEquals(OUT_MPLS_ECMP_PACKET, hitChain.getEgressPacket());
+ assertEquals(chains.get(0), hitChain.hitChain());
+ assertEquals(OUT_MPLS_ECMP_PACKET, hitChain.egressPacket().packet());
}
/**
@@ -664,25 +667,25 @@
*/
@Test
public void testOvsOfdpaL2BroadEmpty() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L2_BROAD_UNTAG_PACKET, OFDPA_CP,
- getDataPlaneEntities(OVS_OFDPA_DRIVER, L2_BROAD_EMPTY_OVS_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L2_BROAD_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, L2_BROAD_EMPTY_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.NO_GROUP_MEMBERS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.NO_GROUP_MEMBERS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L2_BROAD_EMPTY_OVS_OFDPA);
assertThat(chains.size(), is(1));
- assertNull(hitChain.getOutputPort());
- assertThat(hitChain.getHitChain().size(), is(6));
- assertEquals(OUT_L2_BROAD_EMPTY, hitChain.getEgressPacket());
+ assertNull(hitChain.outputPort());
+ assertThat(hitChain.hitChain().size(), is(6));
+ assertEquals(OUT_L2_BROAD_EMPTY, hitChain.egressPacket().packet());
assertTrue(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -690,25 +693,25 @@
*/
@Test
public void testOfdpaL2BroadEmpty() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L2_BROAD_UNTAG_PACKET, OFDPA_CP,
- getDataPlaneEntities(OFDPA_DRIVER, L2_BROAD_EMPTY_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L2_BROAD_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, L2_BROAD_EMPTY_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.NO_GROUP_MEMBERS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.NO_GROUP_MEMBERS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L2_BROAD_EMPTY_OFDPA);
assertThat(chains.size(), is(1));
- assertNull(hitChain.getOutputPort());
- assertThat(hitChain.getHitChain().size(), is(4));
- assertEquals(OUT_L2_BROAD_EMPTY, hitChain.getEgressPacket());
+ assertNull(hitChain.outputPort());
+ assertThat(hitChain.hitChain().size(), is(4));
+ assertEquals(OUT_L2_BROAD_EMPTY, hitChain.egressPacket().packet());
assertTrue(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -716,26 +719,27 @@
*/
@Test
public void testOvsOfdpaL2BridingNotOrdered() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L2_BRIDG_UNTAG_PACKET, OFDPA_CP,
- getDataPlaneEntities(OVS_OFDPA_DRIVER, L2_BRIDG_NOT_ORDERED_OVS_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L2_BRIDG_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER,
+ L2_BRIDG_NOT_ORDERED_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L2_BRIDG_NOT_ORDERED_OVS_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(OUT_PORT));
- assertThat(hitChain.getHitChain().size(), is(6));
- assertEquals(IN_L2_BRIDG_UNTAG_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(OUT_PORT));
+ assertThat(hitChain.hitChain().size(), is(6));
+ assertEquals(IN_L2_BRIDG_UNTAG_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
/**
@@ -743,26 +747,26 @@
*/
@Test
public void testOfdpaL2BridingNotOrdered() {
- PipelineTraceableInput pipelineInput = new PipelineTraceableInput(IN_L2_BRIDG_UNTAG_PACKET, OFDPA_CP,
- getDataPlaneEntities(OFDPA_DRIVER, L2_BRIDG_NOT_ORDERED_OFDPA));
+ PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(
+ IN_L2_BRIDG_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, L2_BRIDG_NOT_ORDERED_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
- assertThat(pipelineOutput.getHitChains().size(), is(1));
- assertThat(pipelineOutput.getResult(), is(PipelineTraceableResult.SUCCESS));
+ assertThat(pipelineOutput.hitChains().size(), is(1));
+ assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
- PipelineTraceableHitChain hitChain = pipelineOutput.getHitChains().get(0);
+ PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L2_BRIDG_NOT_ORDERED_OFDPA);
assertThat(chains.size(), is(1));
- assertNotNull(hitChain.getOutputPort());
- assertThat(hitChain.getOutputPort().port(), is(OUT_PORT));
- assertThat(hitChain.getHitChain().size(), is(4));
- assertEquals(IN_L2_BRIDG_UNTAG_PACKET, hitChain.getEgressPacket());
+ assertNotNull(hitChain.outputPort());
+ assertThat(hitChain.outputPort().port(), is(OUT_PORT));
+ assertThat(hitChain.hitChain().size(), is(4));
+ assertEquals(IN_L2_BRIDG_UNTAG_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
- assertEquals(chains.get(0), hitChain.getHitChain());
+ assertEquals(chains.get(0), hitChain.hitChain());
}
}
\ No newline at end of file
diff --git a/drivers/default/src/test/java/org/onosproject/driver/traceable/TraceableTestObjects.java b/drivers/default/src/test/java/org/onosproject/driver/traceable/TraceableTestObjects.java
index 4ea803c..51a3c05 100644
--- a/drivers/default/src/test/java/org/onosproject/driver/traceable/TraceableTestObjects.java
+++ b/drivers/default/src/test/java/org/onosproject/driver/traceable/TraceableTestObjects.java
@@ -78,7 +78,6 @@
static final TrafficSelector IN_ARP_PACKET = DefaultTrafficSelector.builder()
.matchInPort(OFDPA_CP.port())
- .matchIPDst(IpPrefix.valueOf("255.255.255.255/32"))
.matchEthType(EthType.EtherType.ARP.ethType().toShort())
.matchVlanId(VlanId.NONE)
.build();
@@ -122,7 +121,6 @@
.matchEthDst(LEAF_MAC)
.matchEthType(MPLS_UNICAST.ethType().toShort())
.matchVlanId(VlanId.NONE)
- .matchIPDst(IP_DST_1)
.matchMplsLabel(MPLS_LABEL)
.matchMplsBos(true)
.build();
@@ -132,7 +130,6 @@
.matchEthDst(LEAF_MAC)
.matchEthType(MPLS_UNICAST.ethType().toShort())
.matchVlanId(VlanId.NONE)
- .matchIPDst(IP_DST_1)
.matchMplsLabel(MPLS_LABEL)
.matchMplsBos(true)
.matchMetadata(IPV4.ethType().toShort())
@@ -184,7 +181,6 @@
.matchEthDst(SPINE_MAC)
.matchEthType(IPV4.ethType().toShort())
.matchVlanId(VlanId.NONE)
- .matchIPDst(IP_DST_1)
.build();
static final TrafficSelector OUT_L2_BROAD_EMPTY = DefaultTrafficSelector.builder()