Search in sources :

Example 1 with OFFlowDeleteStrict

use of org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict in project open-kilda by telstra.

the class TransitFlowSegmentRemoveCommandTest method happyPathVlanEncapsulation.

@Test
public void happyPathVlanEncapsulation() throws Exception {
    replayAll();
    TransitFlowSegmentRemoveCommand command = makeCommand(encapsulationVlan);
    verifySuccessCompletion(command.execute(commandProcessor));
    verifyWriteCount(1);
    OFFlowDeleteStrict expected = of.buildFlowDeleteStrict().setPriority(TransitFlowSegmentRemoveCommand.FLOW_PRIORITY).setCookie(U64.of(command.getCookie().getValue())).setCookieMask(U64.NO_MASK).setMatch(OfAdapter.INSTANCE.matchVlanId(of, of.buildMatch(), command.getEncapsulation().getId()).setExact(MatchField.IN_PORT, OFPort.of(command.getIngressIslPort())).build()).build();
    verifyOfMessageEquals(expected, getWriteRecord(0).getRequest());
}
Also used : OFFlowDeleteStrict(org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict) Test(org.junit.Test)

Example 2 with OFFlowDeleteStrict

use of org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict in project open-kilda by telstra.

the class EgressFlowSegmentRemoveCommandTest method happyPathTransitVlan.

@Test
public void happyPathTransitVlan() throws Exception {
    FlowEndpoint ingressEndpoint = new FlowEndpoint(mapSwitchId(dpId), 1, 0);
    EgressFlowSegmentRemoveCommand command = makeCommand(endpointEgressZeroVlan, ingressEndpoint, encapsulationVlan);
    executeCommand(command, 1);
    OFFlowDeleteStrict expected = of.buildFlowDeleteStrict().setPriority(EgressFlowSegmentRemoveCommand.FLOW_PRIORITY).setCookie(U64.of(command.getCookie().getValue())).setCookieMask(U64.NO_MASK).setMatch(OfAdapter.INSTANCE.matchVlanId(of, of.buildMatch(), command.getEncapsulation().getId()).setExact(MatchField.IN_PORT, OFPort.of(command.getIngressIslPort())).build()).build();
    verifyOfMessageEquals(expected, getWriteRecord(0).getRequest());
}
Also used : OFFlowDeleteStrict(org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict) FlowEndpoint(org.openkilda.model.FlowEndpoint) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 OFFlowDeleteStrict (org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict)2 FlowEndpoint (org.openkilda.model.FlowEndpoint)1