Search in sources :

Example 6 with EffectiveIds

use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.

the class OneSwitchFlowInstallFlowModFactoryTest method testMakeOuterOnlyVlanForwardMessage.

private void testMakeOuterOnlyVlanForwardMessage(OneSwitchFlowInstallCommand command) {
    OFFlowAdd expected = makeForwardingMessage(command, 0, OfAdapter.INSTANCE.matchVlanId(of, of.buildMatch(), command.getEndpoint().getOuterVlanId()).setExact(MatchField.IN_PORT, OFPort.of(command.getEndpoint().getPortNumber())).build(), getTargetIngressTableId(), command.getEndpoint().getVlanStack());
    IngressFlowModFactory factory = makeFactory(command);
    verifyOfMessageEquals(expected, factory.makeOuterOnlyVlanForwardMessage(new EffectiveIds(getEffectiveMeterId(command.getMeterConfig()), null)));
}
Also used : EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) OFFlowAdd(org.projectfloodlight.openflow.protocol.OFFlowAdd)

Example 7 with EffectiveIds

use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.

the class IngressCommandInstallTest method noMeterRequested.

@Test
public void noMeterRequested() throws Exception {
    IngressFlowSegmentBase command = makeCommand(endpointIngressSingleVlan, null, makeMetadata());
    switchFeaturesSetup(sw, true);
    expectMakeOuterOnlyVlanForwardMessage(command, new EffectiveIds());
    expectNoMoreOfMessages();
    replayAll();
    CompletableFuture<FlowSegmentReport> result = command.execute(commandProcessor);
    verifySuccessCompletion(result);
    verifyWriteCount(1);
    verifyNoMeterCall((OFFlowAdd) getWriteRecord(0).getRequest());
}
Also used : EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) FlowSegmentReport(org.openkilda.floodlight.command.flow.FlowSegmentReport) Test(org.junit.Test)

Example 8 with EffectiveIds

use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.

the class IngressCommandInstallTest method processOneVlanSingleTable.

protected void processOneVlanSingleTable(IngressFlowSegmentBase command) throws Exception {
    expectMakeOuterOnlyVlanForwardMessage(command, new EffectiveIds(meterConfig.getId(), null));
    executeCommand(command, 1);
}
Also used : EffectiveIds(org.openkilda.floodlight.model.EffectiveIds)

Example 9 with EffectiveIds

use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.

the class IngressCommandRemoveTest method processOneVlanMultiTable.

protected void processOneVlanMultiTable(IngressFlowSegmentBase command) throws Exception {
    expectMakeSingleVlanForwardMessage(command, new EffectiveIds(meterConfig.getId(), null));
    executeCommand(command, 1);
}
Also used : EffectiveIds(org.openkilda.floodlight.model.EffectiveIds)

Example 10 with EffectiveIds

use of org.openkilda.floodlight.model.EffectiveIds in project open-kilda by telstra.

the class IngressCommandRemoveTest method noMeterRequested.

@Test
public void noMeterRequested() throws Exception {
    IngressFlowSegmentBase command = makeCommand(endpointIngressSingleVlan, null, makeMetadata());
    switchFeaturesSetup(sw, false);
    expectMakeOuterOnlyVlanForwardMessage(command, new EffectiveIds());
    expectNoMoreOfMessages();
    replayAll();
    verifySuccessCompletion(command.execute(commandProcessor));
}
Also used : EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) Test(org.junit.Test)

Aggregations

EffectiveIds (org.openkilda.floodlight.model.EffectiveIds)45 Test (org.junit.Test)24 OFAction (org.projectfloodlight.openflow.protocol.action.OFAction)21 OFFlowMod (org.projectfloodlight.openflow.protocol.OFFlowMod)15 OFInstructionApplyActions (org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions)15 OFFlowAdd (org.projectfloodlight.openflow.protocol.OFFlowAdd)12 FlowEndpoint (org.openkilda.model.FlowEndpoint)9 IngressFlowSegmentInstallCommand (org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand)8 RoutingMetadata (org.openkilda.floodlight.utils.metadata.RoutingMetadata)6 FlowSegmentReport (org.openkilda.floodlight.command.flow.FlowSegmentReport)5 SwitchErrorResponseException (org.openkilda.floodlight.error.SwitchErrorResponseException)3 OneSwitchFlowInstallCommand (org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand)2 UnsupportedSwitchOperationException (org.openkilda.floodlight.error.UnsupportedSwitchOperationException)2