use of org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand in project open-kilda by telstra.
the class IngressFlowSegmentInstallFlowModFactoryTest method testMakeDoubleVlanForwardMessageVxLanEncoded.
private void testMakeDoubleVlanForwardMessageVxLanEncoded(MeterConfig meter) {
IngressFlowSegmentInstallCommand command = makeCommand(endpointDoubleVlan, meter, encapsulationVxLan);
FlowEndpoint endpoint = command.getEndpoint();
RoutingMetadata metadata = RoutingMetadata.builder().outerVlanId(endpoint.getOuterVlanId()).build(Collections.emptySet());
List<OFAction> vlanTransformation = OfAdapter.INSTANCE.makeVlanReplaceActions(of, FlowEndpoint.makeVlanStack(endpoint.getInnerVlanId()), Collections.emptyList());
OFFlowAdd expected = makeVxLanForwardingMessage(command, 10, OfAdapter.INSTANCE.matchVlanId(of, of.buildMatch(), endpoint.getInnerVlanId()).setExact(MatchField.IN_PORT, OFPort.of(endpoint.getPortNumber())).setMasked(MatchField.METADATA, OFMetadata.of(metadata.getValue()), OFMetadata.of(metadata.getMask())).build(), getTargetIngressTableId(), vlanTransformation);
IngressFlowModFactory factory = makeFactory(command);
verifyOfMessageEquals(expected, factory.makeDoubleVlanForwardMessage(new EffectiveIds(getEffectiveMeterId(command.getMeterConfig()), null)));
}
use of org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand in project open-kilda by telstra.
the class IngressFlowSegmentInstallFlowModFactoryTest method testMakeOuterOnlyVlanForwardMessageVlanEncoded.
private void testMakeOuterOnlyVlanForwardMessageVlanEncoded(MeterConfig meter) {
IngressFlowSegmentInstallCommand command = makeCommand(endpointSingleVlan, meter, encapsulationVlan);
FlowEndpoint endpoint = command.getEndpoint();
List<OFAction> vlanTransformation = OfAdapter.INSTANCE.makeVlanReplaceActions(of, endpoint.getVlanStack(), makeTransitVlanStack(endpoint, command.getEncapsulation().getId()));
OFFlowAdd expected = makeVlanForwardingMessage(command, 0, OfAdapter.INSTANCE.matchVlanId(of, of.buildMatch(), command.getEndpoint().getOuterVlanId()).setExact(MatchField.IN_PORT, OFPort.of(command.getEndpoint().getPortNumber())).build(), getTargetIngressTableId(), vlanTransformation);
IngressFlowModFactory factory = makeFactory(command);
verifyOfMessageEquals(expected, factory.makeOuterOnlyVlanForwardMessage(new EffectiveIds(getEffectiveMeterId(command.getMeterConfig()), null)));
}
Aggregations