use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity in project ovirt-engine by oVirt.
the class ReplaceGlusterVolumeBrickCommandTest method getReplicatedVolume.
private GlusterVolumeEntity getReplicatedVolume(Guid volumeId, int brickCount) {
GlusterVolumeEntity volume = getVolume(volumeId);
volume.setStatus(GlusterStatus.UP);
volume.setBricks(getBricks(volumeId, "repl", brickCount));
volume.setVolumeType(GlusterVolumeType.REPLICATE);
volume.setReplicaCount(brickCount);
volume.setClusterId(clusterId);
return volume;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity in project ovirt-engine by oVirt.
the class ReplaceGlusterVolumeBrickCommandTest method getDistributedVolume.
private GlusterVolumeEntity getDistributedVolume(Guid volumeId) {
GlusterVolumeEntity volume = getVolume(volumeId);
volume.setStatus((volumeId == volumeId1) ? GlusterStatus.UP : GlusterStatus.DOWN);
volume.setBricks(getBricks(volumeId, "distrib", 2));
volume.setVolumeType(GlusterVolumeType.DISTRIBUTED_REPLICATE);
volume.setClusterId(clusterId);
return volume;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity in project ovirt-engine by oVirt.
the class AbstractRemoveGlusterVolumeBricksCommandTest method getVolume.
protected GlusterVolumeEntity getVolume(Guid id) {
GlusterVolumeEntity volumeEntity = new GlusterVolumeEntity();
volumeEntity.setId(id);
volumeEntity.setName("test-vol");
volumeEntity.addAccessProtocol(AccessProtocol.GLUSTER);
volumeEntity.addTransportType(TransportType.TCP);
volumeEntity.setStatus(GlusterStatus.UP);
volumeEntity.setBricks(getBricks(id));
volumeEntity.setVolumeType(GlusterVolumeType.DISTRIBUTE);
volumeEntity.setClusterId(CLUSTER_ID);
return volumeEntity;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity in project ovirt-engine by oVirt.
the class AddBricksToGlusterVolumeCommandTest method getMultiBrickVolume.
private GlusterVolumeEntity getMultiBrickVolume(Guid volumeId, int brickCount) {
GlusterVolumeEntity volume = getGlusterVolume(volumeId);
volume.setStatus(GlusterStatus.UP);
volume.setBricks(getBricks(volumeId, brickCount));
volume.setClusterId(clusterId);
return volume;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity in project ovirt-engine by oVirt.
the class AddBricksToGlusterVolumeCommandTest method validateFailsOnSameServer.
@Test
public void validateFailsOnSameServer() {
initTestCommand(volumeIdRepl, getBricks(volumeIdRepl, 3, true), 3, 0, false);
GlusterVolumeEntity vol = getMultiBrickVolume(volumeIdRepl, 3);
vol.setVolumeType(GlusterVolumeType.REPLICATE);
vol.setReplicaCount(3);
doReturn(vol).when(volumeDao).getById(volumeIdRepl);
assertFalse(cmd.validate());
}
Aggregations