Search in sources :

Example 16 with PipelineTraceableOutput

use of org.onosproject.net.PipelineTraceableOutput in project onos by opennetworkinglab.

the class OfdpaPipelineTraceableTest method testOfdpaMplsEcmp.

/**
 * Test mpls ecmp routing for ofdpa.
 */
@Test
public void testOfdpaMplsEcmp() {
    PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_MPLS_ECMP_PACKET_OFDPA), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, MPLS_ECMP_OFDPA));
    PipelineTraceable pipelineTraceable = setUpOfdpa();
    PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
    assertNotNull(pipelineOutput);
    assertThat(pipelineOutput.hitChains().size(), is(1));
    assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
    PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
    assertNotNull(hitChain);
    List<List<DataPlaneEntity>> chains = getHitChains(MPLS_ECMP_OFDPA);
    assertThat(chains.size(), is(1));
    assertNotNull(hitChain.outputPort());
    assertThat(hitChain.outputPort().port(), is(UP_PORT_1));
    assertThat(hitChain.hitChain().size(), is(7));
    assertFalse(hitChain.isDropped());
    assertEquals(chains.get(0), hitChain.hitChain());
    assertEquals(OUT_MPLS_ECMP_PACKET, hitChain.egressPacket().packet());
}
Also used : PipelineTraceable(org.onosproject.net.behaviour.PipelineTraceable) List(java.util.List) PipelineTraceableOutput(org.onosproject.net.PipelineTraceableOutput) PipelineTraceableHitChain(org.onosproject.net.PipelineTraceableHitChain) PipelineTraceableInput(org.onosproject.net.PipelineTraceableInput) PipelineTraceablePacket(org.onosproject.net.PipelineTraceablePacket) Test(org.junit.Test)

Example 17 with PipelineTraceableOutput

use of org.onosproject.net.PipelineTraceableOutput in project onos by opennetworkinglab.

the class OfdpaPipelineTraceableTest method testOvsOfdpaPuntIP.

/**
 * Test punt ip for ovs-ofdpa.
 */
@Test
public void testOvsOfdpaPuntIP() {
    PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_PUNT_IP_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, PUNT_IP_OVS_OFDPA));
    PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
    PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
    assertNotNull(pipelineOutput);
    assertThat(pipelineOutput.hitChains().size(), is(1));
    assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
    PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
    assertNotNull(hitChain);
    List<List<DataPlaneEntity>> chains = getHitChains(PUNT_IP_OVS_OFDPA);
    assertThat(chains.size(), is(1));
    assertNotNull(hitChain.outputPort());
    assertThat(hitChain.outputPort().port(), is(PortNumber.CONTROLLER));
    assertThat(hitChain.hitChain().size(), is(7));
    assertEquals(IN_PUNT_IP_PACKET, hitChain.egressPacket().packet());
    assertFalse(hitChain.isDropped());
    assertEquals(chains.get(0), hitChain.hitChain());
}
Also used : PipelineTraceable(org.onosproject.net.behaviour.PipelineTraceable) List(java.util.List) PipelineTraceableOutput(org.onosproject.net.PipelineTraceableOutput) PipelineTraceableHitChain(org.onosproject.net.PipelineTraceableHitChain) PipelineTraceableInput(org.onosproject.net.PipelineTraceableInput) PipelineTraceablePacket(org.onosproject.net.PipelineTraceablePacket) Test(org.junit.Test)

Example 18 with PipelineTraceableOutput

use of org.onosproject.net.PipelineTraceableOutput in project onos by opennetworkinglab.

the class OfdpaPipelineTraceableTest method testOvsOfdpaPuntLldp.

/**
 * Test punt lldp for ovs-ofdpa.
 */
@Test
public void testOvsOfdpaPuntLldp() {
    PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_PUNT_LLDP_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, PUNT_LLDP_OVS_OFDPA));
    PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
    PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
    assertNotNull(pipelineOutput);
    assertThat(pipelineOutput.hitChains().size(), is(1));
    assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
    PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
    assertNotNull(hitChain);
    List<List<DataPlaneEntity>> chains = getHitChains(PUNT_LLDP_OVS_OFDPA);
    assertThat(chains.size(), is(1));
    assertNotNull(hitChain.outputPort());
    assertThat(hitChain.outputPort().port(), is(PortNumber.CONTROLLER));
    assertThat(hitChain.hitChain().size(), is(7));
    assertEquals(IN_PUNT_LLDP_PACKET, hitChain.egressPacket().packet());
    assertFalse(hitChain.isDropped());
    assertEquals(chains.get(0), hitChain.hitChain());
}
Also used : PipelineTraceable(org.onosproject.net.behaviour.PipelineTraceable) List(java.util.List) PipelineTraceableOutput(org.onosproject.net.PipelineTraceableOutput) PipelineTraceableHitChain(org.onosproject.net.PipelineTraceableHitChain) PipelineTraceableInput(org.onosproject.net.PipelineTraceableInput) PipelineTraceablePacket(org.onosproject.net.PipelineTraceablePacket) Test(org.junit.Test)

Example 19 with PipelineTraceableOutput

use of org.onosproject.net.PipelineTraceableOutput in project onos by opennetworkinglab.

the class OfdpaPipelineTraceableTest method testOfdpaL2BridingNotOrdered.

/**
 * Test l2 bridging with l2 interface group that has actions not in order for ofdpa.
 */
@Test
public void testOfdpaL2BridingNotOrdered() {
    PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_L2_BRIDG_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, L2_BRIDG_NOT_ORDERED_OFDPA));
    PipelineTraceable pipelineTraceable = setUpOfdpa();
    PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
    assertNotNull(pipelineOutput);
    assertThat(pipelineOutput.hitChains().size(), is(1));
    assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
    PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
    assertNotNull(hitChain);
    List<List<DataPlaneEntity>> chains = getHitChains(L2_BRIDG_NOT_ORDERED_OFDPA);
    assertThat(chains.size(), is(1));
    assertNotNull(hitChain.outputPort());
    assertThat(hitChain.outputPort().port(), is(OUT_PORT));
    assertThat(hitChain.hitChain().size(), is(4));
    assertEquals(IN_L2_BRIDG_UNTAG_PACKET, hitChain.egressPacket().packet());
    assertFalse(hitChain.isDropped());
    assertEquals(chains.get(0), hitChain.hitChain());
}
Also used : PipelineTraceable(org.onosproject.net.behaviour.PipelineTraceable) List(java.util.List) PipelineTraceableOutput(org.onosproject.net.PipelineTraceableOutput) PipelineTraceableHitChain(org.onosproject.net.PipelineTraceableHitChain) PipelineTraceableInput(org.onosproject.net.PipelineTraceableInput) PipelineTraceablePacket(org.onosproject.net.PipelineTraceablePacket) Test(org.junit.Test)

Example 20 with PipelineTraceableOutput

use of org.onosproject.net.PipelineTraceableOutput in project onos by opennetworkinglab.

the class OfdpaPipelineTraceableTest method testOvsOfdpaL2BroadEmpty.

/**
 * Test failure due l2 flood group with no buckets for ovs-ofdpa.
 */
@Test
public void testOvsOfdpaL2BroadEmpty() {
    PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_L2_BROAD_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, L2_BROAD_EMPTY_OVS_OFDPA));
    PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
    PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
    assertNotNull(pipelineOutput);
    assertThat(pipelineOutput.hitChains().size(), is(1));
    assertThat(pipelineOutput.result(), is(PipelineTraceableResult.NO_GROUP_MEMBERS));
    PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
    assertNotNull(hitChain);
    List<List<DataPlaneEntity>> chains = getHitChains(L2_BROAD_EMPTY_OVS_OFDPA);
    assertThat(chains.size(), is(1));
    assertNull(hitChain.outputPort());
    assertThat(hitChain.hitChain().size(), is(6));
    assertEquals(OUT_L2_BROAD_EMPTY, hitChain.egressPacket().packet());
    assertTrue(hitChain.isDropped());
    assertEquals(chains.get(0), hitChain.hitChain());
}
Also used : PipelineTraceable(org.onosproject.net.behaviour.PipelineTraceable) List(java.util.List) PipelineTraceableOutput(org.onosproject.net.PipelineTraceableOutput) PipelineTraceableHitChain(org.onosproject.net.PipelineTraceableHitChain) PipelineTraceableInput(org.onosproject.net.PipelineTraceableInput) PipelineTraceablePacket(org.onosproject.net.PipelineTraceablePacket) Test(org.junit.Test)

Aggregations

PipelineTraceableHitChain (org.onosproject.net.PipelineTraceableHitChain)21 PipelineTraceableOutput (org.onosproject.net.PipelineTraceableOutput)21 PipelineTraceablePacket (org.onosproject.net.PipelineTraceablePacket)21 List (java.util.List)20 Test (org.junit.Test)20 PipelineTraceableInput (org.onosproject.net.PipelineTraceableInput)20 PipelineTraceable (org.onosproject.net.behaviour.PipelineTraceable)20 ArrayList (java.util.ArrayList)1 ConnectPoint (org.onosproject.net.ConnectPoint)1 DataPlaneEntity (org.onosproject.net.DataPlaneEntity)1 PortNumber (org.onosproject.net.PortNumber)1 DefaultTrafficSelector (org.onosproject.net.flow.DefaultTrafficSelector)1 FlowEntry (org.onosproject.net.flow.FlowEntry)1 IndexTableId (org.onosproject.net.flow.IndexTableId)1 TableId (org.onosproject.net.flow.TableId)1 TrafficSelector (org.onosproject.net.flow.TrafficSelector)1 VlanIdCriterion (org.onosproject.net.flow.criteria.VlanIdCriterion)1 Instruction (org.onosproject.net.flow.instructions.Instruction)1 OutputInstruction (org.onosproject.net.flow.instructions.Instructions.OutputInstruction)1 L2ModificationInstruction (org.onosproject.net.flow.instructions.L2ModificationInstruction)1