use of org.openkilda.model.Vxlan in project open-kilda by telstra.
the class PersistenceDummyEntityFactory method makeTransitVxLan.
private Vxlan makeTransitVxLan(String flowId, PathId pathId) {
Vxlan entity = Vxlan.builder().flowId(flowId).pathId(pathId).vni(idProvider.provideTransitVxLanId()).build();
transitVxLanRepository.add(entity);
return entity;
}
use of org.openkilda.model.Vxlan 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;
}
use of org.openkilda.model.Vxlan 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;
}
use of org.openkilda.model.Vxlan in project open-kilda by telstra.
the class PersistenceDataAdapterTest method shouldProvideCorrectVxlanEncapsulation.
@Test
public void shouldProvideCorrectVxlanEncapsulation() {
PathId pathId = new PathId("path1");
Set<PathId> pathIds = Sets.newHashSet(pathId);
Vxlan vxlan = Vxlan.builder().flowId("flowId").pathId(pathId).vni(8).build();
when(vxlanRepository.findByPathId(pathId, null)).thenReturn(Collections.singletonList(vxlan));
adapter = PersistenceDataAdapter.builder().pathIds(pathIds).persistenceManager(persistenceManager).build();
FlowTransitEncapsulation actual = adapter.getTransitEncapsulation(pathId, null);
assertEquals(FlowEncapsulationType.VXLAN, actual.getType());
assertEquals(vxlan.getVni(), actual.getId().intValue());
adapter.getTransitEncapsulation(pathId, null);
verify(transitVlanRepository).findByPathId(pathId, null);
verify(vxlanRepository).findByPathId(pathId, null);
verifyNoMoreInteractions(transitVlanRepository);
verifyNoMoreInteractions(vxlanRepository);
}
use of org.openkilda.model.Vxlan in project open-kilda by telstra.
the class VxlanPool method addVxlan.
private VxlanEncapsulation addVxlan(Flow flow, PathId pathId, int vxlan) {
Vxlan vxlanEntity = Vxlan.builder().vni(vxlan).flowId(flow.getFlowId()).pathId(pathId).build();
vxlanRepository.add(vxlanEntity);
return VxlanEncapsulation.builder().vxlan(new Vxlan(vxlanEntity)).build();
}
Aggregations