use of org.onosproject.net.PipelineTraceableInput in project onos by opennetworkinglab.
the class OfdpaPipelineTraceableTest method testOvsOfdpaL2BroadcastUntagged.
/**
* Test l2 broadcast with untagged hosts for ovs-ofdpa.
*/
@Test
public void testOvsOfdpaL2BroadcastUntagged() {
PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_L2_BROAD_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, L2_BROAD_UNTAG_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
assertThat(pipelineOutput.hitChains().size(), is(2));
assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L2_BROAD_UNTAG_OVS_OFDPA);
assertThat(chains.size(), is(2));
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(OUT_PORT));
assertThat(hitChain.hitChain().size(), is(7));
assertEquals(IN_L2_BROAD_UNTAG_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
assertEquals(chains.get(0), hitChain.hitChain());
// Dropped chain - input port!
hitChain = pipelineOutput.hitChains().get(1);
assertNotNull(hitChain);
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(PORT));
assertThat(hitChain.hitChain().size(), is(7));
assertEquals(IN_L2_BROAD_UNTAG_PACKET, hitChain.egressPacket().packet());
assertTrue(hitChain.isDropped());
assertEquals(chains.get(1), hitChain.hitChain());
}
use of org.onosproject.net.PipelineTraceableInput in project onos by opennetworkinglab.
the class OfdpaPipelineTraceableTest method testOfdpaL2BroadEmpty.
/**
* Test failure due l2 flood group with no buckets for ofdpa.
*/
@Test
public void testOfdpaL2BroadEmpty() {
PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_L2_BROAD_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, L2_BROAD_EMPTY_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
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_OFDPA);
assertThat(chains.size(), is(1));
assertNull(hitChain.outputPort());
assertThat(hitChain.hitChain().size(), is(4));
assertEquals(OUT_L2_BROAD_EMPTY, hitChain.egressPacket().packet());
assertTrue(hitChain.isDropped());
assertEquals(chains.get(0), hitChain.hitChain());
}
use of org.onosproject.net.PipelineTraceableInput in project onos by opennetworkinglab.
the class OfdpaPipelineTraceableTest method testOvsOfdpaL3Unicast.
/**
* Test l3 unicast routing for ovs-ofdpa.
*/
@Test
public void testOvsOfdpaL3Unicast() {
PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_L3_UCAST_UNTAG_PACKET), UP_OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, L3_UCAST_UNTAG_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(L3_UCAST_UNTAG_OVS_OFDPA);
assertThat(chains.size(), is(1));
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(OUT_PORT));
assertThat(hitChain.hitChain().size(), is(7));
assertEquals(OUT_L3_UCAST_UNTAG_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
assertEquals(chains.get(0), hitChain.hitChain());
}
use of org.onosproject.net.PipelineTraceableInput in project onos by opennetworkinglab.
the class OfdpaPipelineTraceableTest method testOfdpaL3Ecmp.
/**
* Test l3 ecmp routing for ofdpa.
*/
@Test
public void testOfdpaL3Ecmp() {
PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_L3_ECMP_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, L3_ECMP_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
assertThat(pipelineOutput.hitChains().size(), is(2));
assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(L3_ECMP_OFDPA);
assertThat(chains.size(), is(2));
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(UP_PORT));
assertThat(hitChain.hitChain().size(), is(8));
assertEquals(OUT_L3_ECMP_PACKET_OFDPA, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
assertEquals(chains.get(0), hitChain.hitChain());
hitChain = pipelineOutput.hitChains().get(1);
assertNotNull(hitChain);
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(UP_PORT_1));
assertThat(hitChain.hitChain().size(), is(8));
assertEquals(OUT_L3_ECMP_PACKET_OFDPA_1, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
assertEquals(chains.get(1), hitChain.hitChain());
}
use of org.onosproject.net.PipelineTraceableInput 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());
}
Aggregations