use of org.openkilda.messaging.info.event.LldpInfoData in project open-kilda by telstra.
the class PacketServiceTest method testHandleLldpDataUpdateDifferentSystemCapabilities.
@Test
public void testHandleLldpDataUpdateDifferentSystemCapabilities() throws InterruptedException {
LldpInfoData updatedData = createLldpInfoDataData();
updatedData.setSystemCapabilities(CAPABILITIES_2);
runHandleLldpDataWithUpdatedDevice(updatedData);
}
use of org.openkilda.messaging.info.event.LldpInfoData in project open-kilda by telstra.
the class PacketServiceTest method testHandleLldpDataDifferentPortId.
@Test
public void testHandleLldpDataDifferentPortId() {
LldpInfoData updatedData = createLldpInfoDataData();
updatedData.setPortId(PORT_ID_2);
runHandleLldpDataWithAddedDevice(updatedData);
}
use of org.openkilda.messaging.info.event.LldpInfoData in project open-kilda by telstra.
the class PacketServiceTest method testHandleLldpDataUpdateDifferentSystemName.
@Test
public void testHandleLldpDataUpdateDifferentSystemName() throws InterruptedException {
LldpInfoData updatedData = createLldpInfoDataData();
updatedData.setSystemName(SYSTEM_NAME_2);
runHandleLldpDataWithUpdatedDevice(updatedData);
}
use of org.openkilda.messaging.info.event.LldpInfoData 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());
}
use of org.openkilda.messaging.info.event.LldpInfoData in project open-kilda by telstra.
the class PacketServiceTest method runHandleLldpDataWithUpdatedDevice.
private void runHandleLldpDataWithUpdatedDevice(LldpInfoData updatedData) throws InterruptedException {
LldpInfoData data = createLldpInfoDataData();
packetService.handleLldpData(data);
Collection<SwitchConnectedDevice> oldDevices = switchConnectedDeviceRepository.findAll();
assertEquals(1, oldDevices.size());
assertLldpInfoDataDataEqualsSwitchConnectedDevice(data, oldDevices.iterator().next());
SwitchConnectedDevice originalDevice = new SwitchConnectedDevice(oldDevices.iterator().next());
// Need to have a different timestamp in 'data' and 'updatedData' messages.
// More info https://github.com/telstra/open-kilda/issues/3064
updatedData.setTimestamp(data.getTimestamp() + 1000);
// we must update old device
packetService.handleLldpData(updatedData);
Collection<SwitchConnectedDevice> newDevices = switchConnectedDeviceRepository.findAll();
assertEquals(1, newDevices.size());
assertLldpInfoDataDataEqualsSwitchConnectedDevice(updatedData, newDevices.iterator().next());
// time must be updated
assertNotEquals(originalDevice.getTimeLastSeen(), newDevices.iterator().next().getTimeLastSeen());
}
Aggregations