Search in sources :

Example 1 with FlowRelatedData

use of org.openkilda.wfm.topology.connecteddevices.service.PacketService.FlowRelatedData in project open-kilda by telstra.

the class PacketServiceTest method findFlowRelatedDataForVlanFlowTest.

@Test
@Parameters(method = "getVlanFlowParameters")
public void findFlowRelatedDataForVlanFlowTest(int inVlan, int srcVlan, int dstVlan, int transitVlan, List<Integer> vlansInPacket, boolean source) {
    createFlow(FLOW_ID, srcVlan, dstVlan, transitVlan, false, false);
    LldpInfoData data = createLldpInfoDataData(source ? SWITCH_ID_1 : SWITCH_ID_2, vlansInPacket, source ? PORT_NUMBER_1 : PORT_NUMBER_2);
    FlowRelatedData flowRelatedData = packetService.findFlowRelatedDataForVlanFlow(data);
    assertEquals(FLOW_ID, flowRelatedData.getFlowId());
    assertEquals(inVlan, flowRelatedData.getOriginalVlan());
    assertEquals(source, flowRelatedData.getSource());
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) FlowRelatedData(org.openkilda.wfm.topology.connecteddevices.service.PacketService.FlowRelatedData) Parameters(junitparams.Parameters) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 2 with FlowRelatedData

use of org.openkilda.wfm.topology.connecteddevices.service.PacketService.FlowRelatedData in project open-kilda by telstra.

the class PacketServiceTest method findFlowRelatedDataForOneSwitchFlowTest.

@Test
@Parameters(method = "getOneSwitchFlowParameters")
public void findFlowRelatedDataForOneSwitchFlowTest(int inVlan, int srcVlan, int dstVlan, List<Integer> vlansInPacket, boolean source) {
    createFlow(FLOW_ID, srcVlan, dstVlan, null, true, false);
    LldpInfoData data = createLldpInfoDataData(SWITCH_ID_1, vlansInPacket, source ? PORT_NUMBER_1 : PORT_NUMBER_2);
    FlowRelatedData flowRelatedData = packetService.findFlowRelatedDataForOneSwitchFlow(data);
    assertEquals(FLOW_ID, flowRelatedData.getFlowId());
    assertEquals(inVlan, flowRelatedData.getOriginalVlan());
    assertEquals(source, flowRelatedData.getSource());
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) FlowRelatedData(org.openkilda.wfm.topology.connecteddevices.service.PacketService.FlowRelatedData) Parameters(junitparams.Parameters) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 3 with FlowRelatedData

use of org.openkilda.wfm.topology.connecteddevices.service.PacketService.FlowRelatedData in project open-kilda by telstra.

the class PacketServiceTest method findFlowRelatedDataForVxlanFlowTest.

@Test
@Parameters(method = "getInOutVlanCombinationForVxlanParameters")
public void findFlowRelatedDataForVxlanFlowTest(int inVlan, int srcVlan, int dstVlan, List<Integer> vlansInPacket, boolean source) {
    createFlow(FLOW_ID, srcVlan, dstVlan, null, false, false);
    LldpInfoData data = createLldpInfoDataData(source ? SWITCH_ID_1 : SWITCH_ID_2, vlansInPacket, source ? PORT_NUMBER_1 : PORT_NUMBER_2);
    FlowRelatedData flowRelatedData = packetService.findFlowRelatedDataForVxlanFlow(data);
    assertEquals(FLOW_ID, flowRelatedData.getFlowId());
    assertEquals(inVlan, flowRelatedData.getOriginalVlan());
    assertEquals(source, flowRelatedData.getSource());
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) FlowRelatedData(org.openkilda.wfm.topology.connecteddevices.service.PacketService.FlowRelatedData) Parameters(junitparams.Parameters) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 4 with FlowRelatedData

use of org.openkilda.wfm.topology.connecteddevices.service.PacketService.FlowRelatedData in project open-kilda by telstra.

the class PacketServiceTest method findFlowRelatedDataForOneSwitchOnePortFlowTest.

@Test
@Parameters(method = "getOneSwitchOnePortFlowParameters")
public void findFlowRelatedDataForOneSwitchOnePortFlowTest(int inVlan, int srcVlan, int dstVlan, List<Integer> vlansInPacket, boolean source) {
    createFlow(FLOW_ID, srcVlan, dstVlan, null, true, true);
    LldpInfoData data = createLldpInfoDataData(SWITCH_ID_1, vlansInPacket, PORT_NUMBER_1);
    FlowRelatedData flowRelatedData = packetService.findFlowRelatedDataForOneSwitchFlow(data);
    assertEquals(FLOW_ID, flowRelatedData.getFlowId());
    assertEquals(inVlan, flowRelatedData.getOriginalVlan());
    assertEquals(source, flowRelatedData.getSource());
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) FlowRelatedData(org.openkilda.wfm.topology.connecteddevices.service.PacketService.FlowRelatedData) Parameters(junitparams.Parameters) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Aggregations

Parameters (junitparams.Parameters)4 Test (org.junit.Test)4 LldpInfoData (org.openkilda.messaging.info.event.LldpInfoData)4 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)4 FlowRelatedData (org.openkilda.wfm.topology.connecteddevices.service.PacketService.FlowRelatedData)4