Search in sources :

Example 11 with LldpInfoData

use of org.openkilda.messaging.info.event.LldpInfoData in project open-kilda by telstra.

the class PacketServiceTest method runHandleLldpDataWithAddedDevice.

private void runHandleLldpDataWithAddedDevice(LldpInfoData updatedData) {
    LldpInfoData data = createLldpInfoDataData();
    packetService.handleLldpData(data);
    assertEquals(1, switchConnectedDeviceRepository.findAll().size());
    assertLldpConnectedDeviceExistInDatabase(data);
    // we must add second device
    packetService.handleLldpData(updatedData);
    assertEquals(2, switchConnectedDeviceRepository.findAll().size());
    assertLldpConnectedDeviceExistInDatabase(data);
    assertLldpConnectedDeviceExistInDatabase(updatedData);
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData)

Example 12 with LldpInfoData

use of org.openkilda.messaging.info.event.LldpInfoData 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 13 with LldpInfoData

use of org.openkilda.messaging.info.event.LldpInfoData in project open-kilda by telstra.

the class PacketServiceTest method testHandleLldpDataUpdateDifferentTtl.

@Test
public void testHandleLldpDataUpdateDifferentTtl() throws InterruptedException {
    LldpInfoData updatedData = createLldpInfoDataData();
    updatedData.setTtl(TTL_2);
    runHandleLldpDataWithUpdatedDevice(updatedData);
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 14 with LldpInfoData

use of org.openkilda.messaging.info.event.LldpInfoData in project open-kilda by telstra.

the class PacketServiceTest method testHandleLldpDataDifferentSwitchId.

@Test
public void testHandleLldpDataDifferentSwitchId() {
    LldpInfoData updatedData = createLldpInfoDataData();
    updatedData.setSwitchId(SWITCH_ID_2);
    runHandleLldpDataWithAddedDevice(updatedData);
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 15 with LldpInfoData

use of org.openkilda.messaging.info.event.LldpInfoData in project open-kilda by telstra.

the class PacketServiceTest method testHandleLldpDataDifferentChassisId.

@Test
public void testHandleLldpDataDifferentChassisId() {
    LldpInfoData updatedData = createLldpInfoDataData();
    updatedData.setChassisId(CHASSIS_ID_2);
    runHandleLldpDataWithAddedDevice(updatedData);
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Aggregations

LldpInfoData (org.openkilda.messaging.info.event.LldpInfoData)21 Test (org.junit.Test)18 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)18 Parameters (junitparams.Parameters)4 FlowRelatedData (org.openkilda.wfm.topology.connecteddevices.service.PacketService.FlowRelatedData)4 SwitchConnectedDevice (org.openkilda.model.SwitchConnectedDevice)2 Message (org.openkilda.messaging.Message)1 InfoData (org.openkilda.messaging.info.InfoData)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 ArpInfoData (org.openkilda.messaging.info.event.ArpInfoData)1 SwitchId (org.openkilda.model.SwitchId)1