use of org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity in project ovirt-engine by oVirt.
the class AbstractRemoveGlusterVolumeBricksCommandTest method getBricks.
protected List<GlusterBrickEntity> getBricks(Guid volumeId) {
List<GlusterBrickEntity> bricks = new ArrayList<>();
GlusterBrickEntity brick1 = new GlusterBrickEntity();
brick1.setVolumeId(volumeId);
brick1.setId(BRICK_UUID1);
brick1.setBrickDirectory("/tmp/test-vol0");
brick1.setServerId(SERVER_ID);
brick1.setStatus(GlusterStatus.UP);
bricks.add(brick1);
GlusterBrickEntity brick2 = new GlusterBrickEntity();
brick2.setVolumeId(volumeId);
brick2.setId(BRICK_UUID1);
brick2.setBrickDirectory("/tmp/test-vol1");
brick2.setServerId(SERVER_ID);
brick2.setStatus(GlusterStatus.UP);
bricks.add(brick2);
return bricks;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity in project ovirt-engine by oVirt.
the class AddBricksToGlusterVolumeCommandTest method validateSucceedsonServerCheckIncreasingReplica.
@Test
public void validateSucceedsonServerCheckIncreasingReplica() {
List<GlusterBrickEntity> bricks = new ArrayList<>();
bricks.add(getBrick(volumeIdRepl, Guid.newGuid(), "/brick1"));
bricks.add(getBrick(volumeIdRepl, Guid.newGuid(), "/brick2"));
initTestCommand(volumeIdRepl, bricks, 3, 0, false);
doReturn(getVdsStatic()).when(vdsStaticDao).get(any());
GlusterVolumeEntity vol = getMultiBrickVolume(volumeIdRepl, 4);
vol.setVolumeType(GlusterVolumeType.DISTRIBUTED_REPLICATE);
vol.setReplicaCount(2);
doReturn(vol).when(volumeDao).getById(volumeIdRepl);
assertTrue(cmd.validate());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity in project ovirt-engine by oVirt.
the class AddBricksToGlusterVolumeCommandTest method validateSucceedsonServerCheck.
@Test
public void validateSucceedsonServerCheck() {
List<GlusterBrickEntity> bricks = new ArrayList<>();
bricks.add(getBrick(volumeIdRepl, Guid.newGuid(), "/brick1"));
bricks.add(getBrick(volumeIdRepl, Guid.newGuid(), "/brick2"));
initTestCommand(volumeIdRepl, bricks, 2, 0, false);
doReturn(getVdsStatic()).when(vdsStaticDao).get(any());
GlusterVolumeEntity vol = getMultiBrickVolume(volumeIdRepl, 4);
vol.setVolumeType(GlusterVolumeType.DISTRIBUTED_REPLICATE);
vol.setReplicaCount(2);
doReturn(vol).when(volumeDao).getById(volumeIdRepl);
assertTrue(cmd.validate());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity in project ovirt-engine by oVirt.
the class CreateGlusterVolumeCommandTest method getBricks.
private List<GlusterBrickEntity> getBricks(Guid volumeId, int max, boolean withDuplicates) {
List<GlusterBrickEntity> bricks = new ArrayList<>();
GlusterBrickEntity brick = null;
for (Integer i = 0; i < max; i++) {
brick = new GlusterBrickEntity();
brick.setVolumeId(volumeId);
brick.setServerId(serverId);
brick.setServerName(serverName);
brick.setBrickDirectory("/tmp/s" + i.toString());
brick.setStatus(GlusterStatus.UP);
bricks.add(brick);
}
if (max > 0 && withDuplicates) {
bricks.add(brick);
}
return bricks;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity in project ovirt-engine by oVirt.
the class GetGlusterBrickByIdQueryTest method testExecuteQueryCommnad.
@Test
public void testExecuteQueryCommnad() {
getQuery().executeQueryCommand();
GlusterBrickEntity actual = getQuery().getQueryReturnValue().getReturnValue();
assertEquals("wrong Gluster Brick", expected.getId(), actual.getId());
}
Aggregations