Search in sources :

Example 36 with PathId

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

the class FermaIslRepositoryTest method createPathWithSegment.

private FlowPath createPathWithSegment(String pathId, Switch srcSwitch, Integer srcPort, Switch destSwitch, Integer destPort, long bandwidth, String sharedBandwidthGroupId) {
    PathId pathIdAsObj = new PathId(pathId);
    FlowPath path = FlowPath.builder().srcSwitch(srcSwitch).destSwitch(destSwitch).pathId(pathIdAsObj).bandwidth(bandwidth).sharedBandwidthGroupId(sharedBandwidthGroupId).segments(Collections.singletonList(PathSegment.builder().pathId(pathIdAsObj).srcSwitch(srcSwitch).srcPort(srcPort).destSwitch(destSwitch).destPort(destPort).build())).build();
    flowPathRepository.add(path);
    return path;
}
Also used : PathId(org.openkilda.model.PathId) FlowPath(org.openkilda.model.FlowPath)

Example 37 with PathId

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

the class FermaTransitVlanRepositoryTest method findUnassignedTransitVlanAndCreate.

private int findUnassignedTransitVlanAndCreate(String flowId) {
    int availableVlan = transitVlanRepository.findFirstUnassignedVlan(MIN_TRANSIT_VLAN, MAX_TRANSIT_VLAN).get();
    TransitVlan transitVlan = TransitVlan.builder().vlan(availableVlan).pathId(new PathId(TEST_FLOW_ID + "_path")).flowId(flowId).build();
    transitVlanRepository.add(transitVlan);
    return availableVlan;
}
Also used : PathId(org.openkilda.model.PathId) TransitVlan(org.openkilda.model.TransitVlan)

Example 38 with PathId

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

the class PathIdConverterTest method shouldConvertStringToId.

@Test
public void shouldConvertStringToId() {
    // given
    PathId pathId = new PathId("test_path_id");
    // when
    PathId actualEntity = PathIdConverter.INSTANCE.toEntityAttribute(pathId.getId());
    // then
    assertEquals(pathId, actualEntity);
}
Also used : PathId(org.openkilda.model.PathId) Test(org.junit.Test)

Example 39 with PathId

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

the class FermaVxlanRepositoryTest method findUnassignedVxlanAndCreate.

private int findUnassignedVxlanAndCreate(String flowId) {
    int availableVni = vxlanRepository.findFirstUnassignedVxlan(MIN_VNI, MAX_VNI).get();
    Vxlan vxlan = Vxlan.builder().vni(availableVni).pathId(new PathId(TEST_FLOW_ID + "_path")).flowId(flowId).build();
    vxlanRepository.add(vxlan);
    return availableVni;
}
Also used : PathId(org.openkilda.model.PathId) Vxlan(org.openkilda.model.Vxlan)

Example 40 with PathId

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

the class FermaVxlanRepositoryTest method createVxlan.

private Vxlan createVxlan() {
    Vxlan vxlan = Vxlan.builder().vni(1).pathId(new PathId(TEST_FLOW_ID + "_path")).flowId(TEST_FLOW_ID).build();
    vxlanRepository.add(vxlan);
    return vxlan;
}
Also used : PathId(org.openkilda.model.PathId) Vxlan(org.openkilda.model.Vxlan)

Aggregations

PathId (org.openkilda.model.PathId)124 Flow (org.openkilda.model.Flow)65 FlowPath (org.openkilda.model.FlowPath)65 Test (org.junit.Test)44 Switch (org.openkilda.model.Switch)29 SwitchId (org.openkilda.model.SwitchId)28 FlowSegmentCookie (org.openkilda.model.cookie.FlowSegmentCookie)27 PathSegment (org.openkilda.model.PathSegment)26 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)21 MeterId (org.openkilda.model.MeterId)19 ArrayList (java.util.ArrayList)18 List (java.util.List)13 Slf4j (lombok.extern.slf4j.Slf4j)11 GetPathsResult (org.openkilda.pce.GetPathsResult)11 FlowMirrorPoints (org.openkilda.model.FlowMirrorPoints)10 Path (org.openkilda.pce.Path)10 Collection (java.util.Collection)9 RecoverableException (org.openkilda.pce.exception.RecoverableException)9 String.format (java.lang.String.format)8 HashMap (java.util.HashMap)8