Search in sources :

Example 1 with LldpInfoData

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

the class PacketServiceTest method testHandleLldpDataDifferentPortNumber.

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

Example 2 with LldpInfoData

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

the class PacketServiceTest method testHandleLldpDataNonExistentSwitch.

@Test
public void testHandleLldpDataNonExistentSwitch() {
    LldpInfoData data = createLldpInfoDataData();
    data.setSwitchId(new SwitchId("12345"));
    packetService.handleLldpData(data);
    assertTrue(switchConnectedDeviceRepository.findAll().isEmpty());
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) SwitchId(org.openkilda.model.SwitchId) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 3 with LldpInfoData

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

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

the class PacketServiceTest method testHandleLldpDataSameTimeOnCreate.

@Test
public void testHandleLldpDataSameTimeOnCreate() {
    LldpInfoData data = createLldpInfoDataData();
    packetService.handleLldpData(data);
    Collection<SwitchConnectedDevice> devices = switchConnectedDeviceRepository.findAll();
    assertEquals(1, devices.size());
    assertEquals(devices.iterator().next().getTimeFirstSeen(), devices.iterator().next().getTimeLastSeen());
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) SwitchConnectedDevice(org.openkilda.model.SwitchConnectedDevice) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 5 with LldpInfoData

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

the class PacketServiceTest method testHandleLldpDataUpdateDifferentSystemDescription.

@Test
public void testHandleLldpDataUpdateDifferentSystemDescription() throws InterruptedException {
    LldpInfoData updatedData = createLldpInfoDataData();
    updatedData.setSystemDescription(SYSTEM_DESCRIPTION_2);
    runHandleLldpDataWithUpdatedDevice(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