use of org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentBase in project open-kilda by telstra.
the class IngressFlowModFactoryTest method makeOuterVlanMatchSharedMessage.
// --- makeOuterVlanMatchSharedMessage
@Test
public void makeOuterVlanMatchSharedMessage() {
final IngressFlowModFactory factory = makeFactory();
final IngressFlowSegmentBase command = factory.getCommand();
final FlowEndpoint endpoint = command.getEndpoint();
RoutingMetadata metadata = RoutingMetadata.builder().outerVlanId(endpoint.getOuterVlanId()).build(Collections.emptySet());
OFFlowAdd expected = of.buildFlowAdd().setTableId(getTargetPreIngressTableId()).setPriority(FlowSegmentCommand.FLOW_PRIORITY).setCookie(U64.of(FlowSharedSegmentCookie.builder(SharedSegmentType.QINQ_OUTER_VLAN).portNumber(endpoint.getPortNumber()).vlanId(endpoint.getOuterVlanId()).build().getValue())).setMatch(OfAdapter.INSTANCE.matchVlanId(of, of.buildMatch(), endpoint.getOuterVlanId()).setExact(MatchField.IN_PORT, OFPort.of(endpoint.getPortNumber())).build()).setInstructions(ImmutableList.of(of.instructions().applyActions(Collections.singletonList(of.actions().popVlan())), of.instructions().writeMetadata(metadata.getValue(), metadata.getMask()), of.instructions().gotoTable(TableId.of(SwitchManager.INGRESS_TABLE_ID)))).build();
verifyOfMessageEquals(expected, factory.makeOuterVlanMatchSharedMessage());
}
Aggregations