Search in sources :

Example 1 with OneSwitchFlowInstallCommand

use of org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand in project open-kilda by telstra.

the class OneSwitchFlowInstallFlowModFactoryTest method makeOuterOnlyVlanForwardMessageMeteredOneToOne.

@Test
public void makeOuterOnlyVlanForwardMessageMeteredOneToOne() {
    OneSwitchFlowInstallCommand command = makeCommand(endpointSingleVlan, egressEndpointSingleVlan, meterConfig);
    testMakeOuterOnlyVlanForwardMessage(command);
}
Also used : OneSwitchFlowInstallCommand(org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand) Test(org.junit.Test)

Example 2 with OneSwitchFlowInstallCommand

use of org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand in project open-kilda by telstra.

the class OneSwitchFlowInstallFlowModFactoryTest method makeDefaultPortForwardMessageMessageMeteredZeroToDouble.

@Test
public void makeDefaultPortForwardMessageMessageMeteredZeroToDouble() {
    OneSwitchFlowInstallCommand command = makeCommand(endpointZeroVlan, egressEndpointDoubleVlan, meterConfig);
    testMakeDefaultPortForwardMessageMessage(command);
}
Also used : OneSwitchFlowInstallCommand(org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand) Test(org.junit.Test)

Example 3 with OneSwitchFlowInstallCommand

use of org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand in project open-kilda by telstra.

the class OneSwitchFlowInstallFlowModFactoryTest method makeOuterOnlyVlanForwardMessageMeterless.

@Test
public void makeOuterOnlyVlanForwardMessageMeterless() {
    OneSwitchFlowInstallCommand command = makeCommand(endpointSingleVlan, egressEndpointSingleVlan, null);
    testMakeOuterOnlyVlanForwardMessage(command);
}
Also used : OneSwitchFlowInstallCommand(org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand) Test(org.junit.Test)

Example 4 with OneSwitchFlowInstallCommand

use of org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand in project open-kilda by telstra.

the class OneSwitchFlowInstallFlowModFactoryTest method testMakeDoubleVlanForwardMessageVlanEncoded.

private void testMakeDoubleVlanForwardMessageVlanEncoded(MeterConfig meter) {
    OneSwitchFlowInstallCommand command = makeCommand(endpointDoubleVlan, egressEndpointDoubleVlan, meter);
    FlowEndpoint endpoint = command.getEndpoint();
    RoutingMetadata metadata = RoutingMetadata.builder().outerVlanId(endpoint.getOuterVlanId()).build(Collections.emptySet());
    OFFlowAdd expected = makeForwardingMessage(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(), FlowEndpoint.makeVlanStack(endpoint.getInnerVlanId()));
    IngressFlowModFactory factory = makeFactory(command);
    verifyOfMessageEquals(expected, factory.makeDoubleVlanForwardMessage(new EffectiveIds(getEffectiveMeterId(command.getMeterConfig()), null)));
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) OneSwitchFlowInstallCommand(org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand) RoutingMetadata(org.openkilda.floodlight.utils.metadata.RoutingMetadata) OFFlowAdd(org.projectfloodlight.openflow.protocol.OFFlowAdd)

Example 5 with OneSwitchFlowInstallCommand

use of org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand in project open-kilda by telstra.

the class OneSwitchFlowInstallFlowModFactoryTest method testMakeSingleVlanForwardMessage.

private void testMakeSingleVlanForwardMessage(MeterConfig meter) {
    OneSwitchFlowInstallCommand command = makeCommand(endpointSingleVlan, egressEndpointSingleVlan, meter);
    FlowEndpoint endpoint = command.getEndpoint();
    RoutingMetadata metadata = RoutingMetadata.builder().outerVlanId(endpoint.getOuterVlanId()).build(Collections.emptySet());
    OFFlowAdd expected = makeForwardingMessage(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(), FlowEndpoint.makeVlanStack(endpoint.getInnerVlanId()));
    IngressFlowModFactory factory = makeFactory(command);
    verifyOfMessageEquals(expected, factory.makeSingleVlanForwardMessage(new EffectiveIds(getEffectiveMeterId(command.getMeterConfig()), null)));
}
Also used : FlowEndpoint(org.openkilda.model.FlowEndpoint) EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) OneSwitchFlowInstallCommand(org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand) RoutingMetadata(org.openkilda.floodlight.utils.metadata.RoutingMetadata) OFFlowAdd(org.projectfloodlight.openflow.protocol.OFFlowAdd)

Aggregations

OneSwitchFlowInstallCommand (org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand)11 Test (org.junit.Test)8 FlowEndpoint (org.openkilda.model.FlowEndpoint)4 EffectiveIds (org.openkilda.floodlight.model.EffectiveIds)2 RoutingMetadata (org.openkilda.floodlight.utils.metadata.RoutingMetadata)2 OFFlowAdd (org.projectfloodlight.openflow.protocol.OFFlowAdd)2 FlowSegmentWrapperCommand (org.openkilda.floodlight.command.flow.FlowSegmentWrapperCommand)1 RulesContext (org.openkilda.floodlight.model.RulesContext)1 MeterConfig (org.openkilda.model.MeterConfig)1 OFMeterConfig (org.projectfloodlight.openflow.protocol.OFMeterConfig)1