Search in sources :

Example 16 with NodeId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId 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);
}
Also used : Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow) NxAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow) GeneralAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlow) Test(org.junit.Test)

Example 17 with NodeId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId 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);
}
Also used : Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) Instruction(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction) Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow) NxAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow) GeneralAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlow) Test(org.junit.Test)

Example 18 with NodeId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId 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);
}
Also used : Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow) NxAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow) GeneralAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlow) Test(org.junit.Test)

Example 19 with NodeId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId 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);
}
Also used : Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow) NxAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow) GeneralAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlow) Test(org.junit.Test)

Example 20 with NodeId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId in project netvirt by opendaylight.

the class OpenFlow13ProviderTest method createIngressClassifierFilterNoNshFlow.

@Test
public void createIngressClassifierFilterNoNshFlow() {
    Flow flow = openflowProvider.createIngressClassifierFilterNoNshFlow(nodeId);
    assertEquals(flow.getTableId().shortValue(), NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE);
    assertEquals(flow.getPriority().intValue(), OpenFlow13Provider.INGRESS_CLASSIFIER_FILTER_NONSH_PRIORITY);
    assertEquals(flow.getId().getValue(), OpenFlow13Provider.INGRESS_CLASSIFIER_FILTER_NONSH_FLOW_NAME + nodeId.getValue());
    assertEquals(flow.getCookie().getValue(), OpenFlow13Provider.INGRESS_CLASSIFIER_FILTER_COOKIE);
    checkMatchEmpty(flow.getMatch());
    assertEquals(1, flow.getInstructions().getInstruction().size());
    checkActionGotoTable(flow.getInstructions().getInstruction().get(0).getInstruction(), NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE);
}
Also used : Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow) NxAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow) GeneralAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlow) Test(org.junit.Test)

Aggregations

NodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)105 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)95 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)73 ArrayList (java.util.ArrayList)68 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)68 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)65 Test (org.junit.Test)56 NodeKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey)42 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)35 BigInteger (java.math.BigInteger)31 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)30 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)29 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)28 ExecutionException (java.util.concurrent.ExecutionException)25 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)25 NodeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder)25 L2GatewayDevice (org.opendaylight.netvirt.neutronvpn.api.l2gw.L2GatewayDevice)24 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)23 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)20 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)19