Search in sources :

Example 11 with LagLogicalPort

use of org.openkilda.model.LagLogicalPort in project open-kilda by telstra.

the class FermaLagLogicalPortTest method createLogicalPortWithPhysicalPortsTest.

@Test
public void createLogicalPortWithPhysicalPortsTest() {
    LagLogicalPort logicalPort = createLogicalPort(SWITCH_ID_1, LOGICAL_PORT_NUMBER_1, PHYSICAL_PORT_NUMBER_1, PHYSICAL_PORT_NUMBER_2);
    List<LagLogicalPort> ports = new ArrayList<>(lagLogicalPortRepository.findAll());
    assertEquals(1, ports.size());
    assertEquals(2, ports.get(0).getPhysicalPorts().size());
    assertEquals(PHYSICAL_PORT_NUMBER_1, ports.get(0).getPhysicalPorts().get(0).getPortNumber());
    assertEquals(PHYSICAL_PORT_NUMBER_2, ports.get(0).getPhysicalPorts().get(1).getPortNumber());
    assertEquals(SWITCH_ID_1, ports.get(0).getPhysicalPorts().get(0).getSwitchId());
    assertEquals(SWITCH_ID_1, ports.get(0).getPhysicalPorts().get(1).getSwitchId());
    assertEquals(logicalPort, ports.get(0).getPhysicalPorts().get(0).getLagLogicalPort());
    assertEquals(logicalPort, ports.get(0).getPhysicalPorts().get(1).getLagLogicalPort());
}
Also used : LagLogicalPort(org.openkilda.model.LagLogicalPort) ArrayList(java.util.ArrayList) InMemoryGraphBasedTest(org.openkilda.persistence.inmemory.InMemoryGraphBasedTest) Test(org.junit.Test)

Aggregations

LagLogicalPort (org.openkilda.model.LagLogicalPort)11 Test (org.junit.Test)6 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)4 ArrayList (java.util.ArrayList)3 Switch (org.openkilda.model.Switch)3 PhysicalPort (org.openkilda.model.PhysicalPort)2 InvalidDataException (org.openkilda.wfm.topology.switchmanager.error.InvalidDataException)2 LogicalPortInfoEntry (org.openkilda.messaging.info.switches.LogicalPortInfoEntry)1 LagPortDto (org.openkilda.messaging.nbtopology.response.LagPortDto)1 SwitchFeature (org.openkilda.model.SwitchFeature)1 LagPortNotFoundException (org.openkilda.wfm.topology.switchmanager.error.LagPortNotFoundException)1