Search in sources :

Example 6 with LldpInfoData

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

the class PacketServiceTest method testHandleLldpDataDifferentMac.

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

Example 7 with LldpInfoData

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

the class PacketServiceTest method testHandleLldpDataDifferentVlan.

@Test
public void testHandleLldpDataDifferentVlan() {
    LldpInfoData updatedData = createLldpInfoDataData();
    updatedData.setVlans(Collections.singletonList(VLAN_2));
    runHandleLldpDataWithAddedDevice(updatedData);
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Example 8 with LldpInfoData

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

the class PacketServiceTest method testHandleLldpDataUpdateDifferentPortDescription.

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

Example 9 with LldpInfoData

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

the class PacketBolt method handleInput.

@Override
protected void handleInput(Tuple input) throws PipelineException {
    if (active) {
        Message message = pullValue(input, FIELD_ID_PAYLOAD, Message.class);
        if (message instanceof InfoMessage) {
            log.debug("Received info message {}", message);
            InfoData data = ((InfoMessage) message).getData();
            if (data instanceof LldpInfoData) {
                packetService.handleLldpData((LldpInfoData) data);
            } else if (data instanceof ArpInfoData) {
                packetService.handleArpData((ArpInfoData) data);
            } else {
                unhandledInput(input);
            }
        } else {
            unhandledInput(input);
        }
    }
}
Also used : LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData) ArpInfoData(org.openkilda.messaging.info.event.ArpInfoData) InfoMessage(org.openkilda.messaging.info.InfoMessage) Message(org.openkilda.messaging.Message) InfoMessage(org.openkilda.messaging.info.InfoMessage) ArpInfoData(org.openkilda.messaging.info.event.ArpInfoData) InfoData(org.openkilda.messaging.info.InfoData) LldpInfoData(org.openkilda.messaging.info.event.LldpInfoData)

Example 10 with LldpInfoData

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

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