use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method createIngressClassifierAclNoMatchFlow.
@Test
public void createIngressClassifierAclNoMatchFlow() {
Flow flow = openflowProvider.createIngressClassifierAclNoMatchFlow(nodeId);
assertEquals(flow.getTableId().shortValue(), NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE);
assertEquals(flow.getPriority().intValue(), OpenFlow13Provider.INGRESS_CLASSIFIER_ACL_NOMATCH_PRIORITY);
assertEquals(flow.getId().getValue(), OpenFlow13Provider.INGRESS_CLASSIFIER_ACL_FLOW_NAME + "_" + nodeId.getValue());
assertEquals(flow.getCookie().getValue(), OpenFlow13Provider.INGRESS_CLASSIFIER_ACL_COOKIE);
checkMatchEmpty(flow.getMatch());
assertEquals(1, flow.getInstructions().getInstruction().size());
checkActionResubmit(flow.getInstructions().getInstruction().get(0).getInstruction(), NwConstants.LPORT_DISPATCHER_TABLE);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method createEgressClassifierNextHopNoC1C2Flow.
@Test
public void createEgressClassifierNextHopNoC1C2Flow() {
Flow flow = openflowProvider.createEgressClassifierNextHopNoC1C2Flow(nodeId);
assertEquals(flow.getTableId().shortValue(), NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE);
assertEquals(flow.getPriority().intValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_PRIORITY);
assertEquals(flow.getId().getValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_FLOW_NAME + nodeId.getValue());
assertEquals(flow.getCookie().getValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_NEXTHOP_COOKIE);
checkMatchC1(flow.getMatch(), OpenFlow13Provider.DEFAULT_NSH_CONTEXT_VALUE);
checkMatchC2(flow.getMatch(), OpenFlow13Provider.DEFAULT_NSH_CONTEXT_VALUE);
assertEquals(2, flow.getInstructions().getInstruction().size());
Instruction curInstruction = flow.getInstructions().getInstruction().get(0).getInstruction();
List<Action> actionList = checkApplyActionSize(curInstruction, 4);
checkActionMoveTunReg(actionList.get(0), NxmNxReg0.class, true);
checkActionMoveNsc1(actionList.get(0), false);
checkActionMoveTunId(actionList.get(1), true);
checkActionMoveNsc2(actionList.get(1), false);
checkActionMoveTunReg(actionList.get(2), NxmNxReg6.class, true);
checkActionMoveNsc4(actionList.get(2), false);
checkActionLoadTunId(actionList.get(3), OpenFlow13Provider.SFC_TUNNEL_ID);
curInstruction = flow.getInstructions().getInstruction().get(1).getInstruction();
checkActionGotoTable(curInstruction, NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method checkActionResubmit.
//
// Internal util methods to check Flow Actions
//
private void checkActionResubmit(Instruction curInstruction, short nextTableId) {
assertTrue(curInstruction instanceof ApplyActionsCase);
boolean resubmitActionFound = false;
for (Action action : ((ApplyActionsCase) curInstruction).getApplyActions().getAction()) {
if (action.getAction() instanceof NxActionResubmitNodesNodeTableFlowWriteActionsCase) {
NxActionResubmitNodesNodeTableFlowWriteActionsCase resubmitAction = (NxActionResubmitNodesNodeTableFlowWriteActionsCase) action.getAction();
assertEquals(resubmitAction.getNxResubmit().getTable().shortValue(), nextTableId);
resubmitActionFound = true;
}
}
assertTrue(resubmitActionFound);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method createEgressClassifierFilterNshFlow.
@Test
public void createEgressClassifierFilterNshFlow() {
Flow flow = openflowProvider.createEgressClassifierFilterNshFlow(nodeId);
assertEquals(flow.getTableId().shortValue(), NwConstants.EGRESS_SFC_CLASSIFIER_FILTER_TABLE);
assertEquals(flow.getPriority().intValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_FILTER_NSH_PRIORITY);
assertEquals(flow.getId().getValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_FILTER_NSH_FLOW_NAME + nodeId.getValue());
assertEquals(flow.getCookie().getValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_FILTER_COOKIE);
checkMatchNshMdType1(flow.getMatch());
assertEquals(2, flow.getInstructions().getInstruction().size());
List<Action> actionList;
actionList = checkApplyActionSize(flow.getInstructions().getInstruction().get(0).getInstruction(), 1);
checkActionLoadNshc1(actionList.get(0), OpenFlow13Provider.DEFAULT_NSH_CONTEXT_VALUE);
checkActionGotoTable(flow.getInstructions().getInstruction().get(1).getInstruction(), NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method createEgressClassifierNextHopC1C2Flow.
@Test
public void createEgressClassifierNextHopC1C2Flow() {
Flow flow = openflowProvider.createEgressClassifierNextHopC1C2Flow(nodeId);
assertEquals(flow.getTableId().shortValue(), NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE);
assertEquals(flow.getPriority().intValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_NEXTHOP_C1C2_PRIORITY);
assertEquals(flow.getId().getValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_NEXTHOP_C1C2_FLOW_NAME + nodeId.getValue());
assertEquals(flow.getCookie().getValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_NEXTHOP_COOKIE);
checkMatchEmpty(flow.getMatch());
assertEquals(1, flow.getInstructions().getInstruction().size());
checkActionGotoTable(flow.getInstructions().getInstruction().get(0).getInstruction(), NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE);
}
Aggregations