use of org.onosproject.net.PipelineTraceableInput in project onos by opennetworkinglab.
the class OfdpaPipelineTraceableTest method testOfdpaArp.
/**
* Test punt arp for ovs-ofdpa.
*/
@Test
public void testOfdpaArp() {
PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_ARP_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, ARP_OFDPA));
PipelineTraceable pipelineTraceable = setUpOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
assertThat(pipelineOutput.hitChains().size(), is(3));
assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(ARP_OFDPA);
assertThat(chains.size(), is(3));
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(PortNumber.CONTROLLER));
assertThat(hitChain.hitChain().size(), is(4));
assertEquals(IN_ARP_PACKET, 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(OUT_PORT));
assertThat(hitChain.hitChain().size(), is(6));
assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
assertEquals(chains.get(1), hitChain.hitChain());
hitChain = pipelineOutput.hitChains().get(2);
assertNotNull(hitChain);
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(PORT));
assertThat(hitChain.hitChain().size(), is(6));
assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertTrue(hitChain.isDropped());
assertEquals(chains.get(2), hitChain.hitChain());
}
use of org.onosproject.net.PipelineTraceableInput in project onos by opennetworkinglab.
the class OfdpaPipelineTraceableTest method testOvsOfdpaL3Ecmp.
/**
* Test l3 ecmp routing for ovs-ofdpa.
*/
@Test
public void testOvsOfdpaL3Ecmp() {
PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_L3_ECMP_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, L3_ECMP_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(L3_ECMP_OVS_OFDPA);
assertThat(chains.size(), is(2));
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(UP_PORT));
assertThat(hitChain.hitChain().size(), is(9));
assertEquals(OUT_L3_ECMP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
assertEquals(chains.get(0), hitChain.hitChain());
// 2nd spine!
hitChain = pipelineOutput.hitChains().get(1);
assertNotNull(hitChain);
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(UP_PORT_1));
assertThat(hitChain.hitChain().size(), is(9));
assertEquals(OUT_L3_ECMP_PACKET_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 testOvsOfdpaL2BridingNotOrdered.
/**
* Test l2 bridging with l2 interface group that has actions not in order for ovs-ofdpa.
*/
@Test
public void testOvsOfdpaL2BridingNotOrdered() {
PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_L2_BRIDG_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, L2_BRIDG_NOT_ORDERED_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(L2_BRIDG_NOT_ORDERED_OVS_OFDPA);
assertThat(chains.size(), is(1));
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(OUT_PORT));
assertThat(hitChain.hitChain().size(), is(6));
assertEquals(IN_L2_BRIDG_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 testOfdpaL2BroadcastUntagged.
/**
* Test l2 broadcast with untagged hosts for ofdpa.
*/
@Test
public void testOfdpaL2BroadcastUntagged() {
PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_L2_BROAD_UNTAG_PACKET), OFDPA_CP, getDataPlaneEntities(OFDPA_DRIVER, L2_BROAD_UNTAG_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(L2_BROAD_UNTAG_OFDPA);
assertThat(chains.size(), is(2));
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(OUT_PORT));
assertThat(hitChain.hitChain().size(), is(5));
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(5));
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 testOvsOfdpaArp.
/**
* Test punt arp for ovs-ofdpa.
*/
@Test
public void testOvsOfdpaArp() {
PipelineTraceableInput pipelineInput = new PipelineTraceableInput(new PipelineTraceablePacket(IN_ARP_PACKET), OFDPA_CP, getDataPlaneEntities(OVS_OFDPA_DRIVER, ARP_OVS_OFDPA));
PipelineTraceable pipelineTraceable = setUpOvsOfdpa();
PipelineTraceableOutput pipelineOutput = pipelineTraceable.apply(pipelineInput);
assertNotNull(pipelineOutput);
assertThat(pipelineOutput.hitChains().size(), is(3));
assertThat(pipelineOutput.result(), is(PipelineTraceableResult.SUCCESS));
PipelineTraceableHitChain hitChain = pipelineOutput.hitChains().get(0);
assertNotNull(hitChain);
List<List<DataPlaneEntity>> chains = getHitChains(ARP_OVS_OFDPA);
assertThat(chains.size(), is(3));
// This is the copy sent to the controller
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(PortNumber.CONTROLLER));
assertThat(hitChain.hitChain().size(), is(7));
assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
assertEquals(chains.get(0), hitChain.hitChain());
// This is the copy sent to the member port
hitChain = pipelineOutput.hitChains().get(1);
assertNotNull(hitChain);
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(OUT_PORT));
assertThat(hitChain.hitChain().size(), is(8));
assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertFalse(hitChain.isDropped());
assertEquals(chains.get(1), hitChain.hitChain());
// This is the copy sent on the input port
hitChain = pipelineOutput.hitChains().get(2);
assertNotNull(hitChain);
assertNotNull(hitChain.outputPort());
assertThat(hitChain.outputPort().port(), is(PORT));
assertThat(hitChain.hitChain().size(), is(8));
assertEquals(IN_ARP_PACKET, hitChain.egressPacket().packet());
assertTrue(hitChain.isDropped());
assertEquals(chains.get(2), hitChain.hitChain());
}
Aggregations