use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.
the class IngressFlowSegmentInstallFlowModFactoryTest method makeOuterVlanOnlyForwardMessageConnectedDevices.
@Test
public void makeOuterVlanOnlyForwardMessageConnectedDevices() {
FlowEndpoint endpoint = new FlowEndpoint(endpointSingleVlan.getSwitchId(), endpointSingleVlan.getPortNumber(), endpointSingleVlan.getOuterVlanId(), 0, true, true);
IngressFlowSegmentInstallCommand command = makeCommand(endpoint, meterConfig, encapsulationVlan);
IngressFlowModFactory factory = makeFactory(command);
verifyGoToTableInstruction(factory.makeOuterOnlyVlanForwardMessage(new EffectiveIds(meterConfig.getId(), null)));
}
use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.
the class IngressFlowSegmentInstallFlowModFactoryTest method testMakeSingleVlanForwardMessageVlanEncoded.
private void testMakeSingleVlanForwardMessageVlanEncoded(MeterConfig meter) {
IngressFlowSegmentInstallCommand command = makeCommand(endpointSingleVlan, meter, encapsulationVlan);
FlowEndpoint endpoint = command.getEndpoint();
RoutingMetadata metadata = RoutingMetadata.builder().outerVlanId(endpoint.getOuterVlanId()).build(Collections.emptySet());
List<OFAction> vlanTransformation = OfAdapter.INSTANCE.makeVlanReplaceActions(of, Collections.emptyList(), Collections.singletonList(command.getEncapsulation().getId()));
OFFlowAdd expected = makeVlanForwardingMessage(command, 0, of.buildMatch().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.makeSingleVlanForwardMessage(new EffectiveIds(getEffectiveMeterId(command.getMeterConfig()), null)));
}
use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.
the class IngressFlowSegmentInstallFlowModFactoryTest method testMakeDoubleVlanForwardMessageVlanEncoded.
private void testMakeDoubleVlanForwardMessageVlanEncoded(MeterConfig meter) {
IngressFlowSegmentInstallCommand command = makeCommand(endpointDoubleVlan, meter, encapsulationVlan);
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()), FlowEndpoint.makeVlanStack(command.getEncapsulation().getId()));
OFFlowAdd expected = makeVlanForwardingMessage(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.model.FlowEndpoint in project open-kilda by telstra.
the class IngressFlowSegmentInstallFlowModFactoryTest method testMakeSingleVlanForwardMessageVxLanEncoded.
private void testMakeSingleVlanForwardMessageVxLanEncoded(MeterConfig meter) {
IngressFlowSegmentInstallCommand command = makeCommand(endpointSingleVlan, meter, encapsulationVxLan);
FlowEndpoint endpoint = command.getEndpoint();
RoutingMetadata metadata = RoutingMetadata.builder().outerVlanId(endpoint.getOuterVlanId()).build(Collections.emptySet());
OFFlowAdd expected = makeVxLanForwardingMessage(command, 0, of.buildMatch().setExact(MatchField.IN_PORT, OFPort.of(endpoint.getPortNumber())).setMasked(MatchField.METADATA, OFMetadata.of(metadata.getValue()), OFMetadata.of(metadata.getMask())).build(), getTargetIngressTableId(), Collections.emptyList());
IngressFlowModFactory factory = makeFactory(command);
verifyOfMessageEquals(expected, factory.makeSingleVlanForwardMessage(new EffectiveIds(getEffectiveMeterId(command.getMeterConfig()), null)));
}
use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.
the class IngressFlowSegmentInstallFlowModFactoryTest method makeDefaultPortForwardMessageConnectedDevices.
@Test
public void makeDefaultPortForwardMessageConnectedDevices() {
FlowEndpoint endpoint = new FlowEndpoint(endpointSingleVlan.getSwitchId(), endpointSingleVlan.getPortNumber(), endpointSingleVlan.getOuterVlanId(), 0, true, true);
IngressFlowSegmentInstallCommand command = makeCommand(endpoint, meterConfig, encapsulationVlan);
IngressFlowModFactory factory = makeFactory(command);
verifyGoToTableInstruction(factory.makeDefaultPortForwardMessage(new EffectiveIds(meterConfig.getId(), null)));
}
Aggregations