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);
}
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());
}
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());
}
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());
}
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);
}
Aggregations