use of org.openkilda.floodlight.OFFactoryVer12Mock in project open-kilda by telstra.
the class SwitchManagerOF12Test method installTransitFlow.
@Test
public void installTransitFlow() throws Exception {
Capture<OFFlowMod> capture = prepareForInstallFlowOperation();
String flowId = "test-transit-flow-rule";
int inputPort = 2;
int outputPort = 4;
int transitVlanId = 512;
switchManager.installTransitFlow(switchDpId, flowId, commonFlowCookie, inputPort, outputPort, transitVlanId);
OFFactory referenceOfFactory = new OFFactoryVer12Mock();
OFFlowMod expected = referenceOfFactory.buildFlowAdd().setCookie(U64.of(commonFlowCookie).applyMask(U64.of(SwitchManager.FLOW_COOKIE_MASK))).setPriority(FlowModUtils.PRIORITY_VERY_HIGH).setMatch(referenceOfFactory.buildMatch().setExact(MatchField.IN_PORT, OFPort.of(inputPort)).setMasked(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(transitVlanId), OFVlanVidMatch.ofRawVid((short) 0x0FFF)).build()).setInstructions(singletonList(referenceOfFactory.instructions().applyActions(singletonList(referenceOfFactory.actions().buildOutput().setMaxLen(0xFFFFFFFF).setPort(OFPort.of(outputPort)).build())).createBuilder().build())).build();
assertEquals(expected, capture.getValue());
}
Aggregations