Search in sources :

Example 96 with GlusterVolumeEntity

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;
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)

Example 97 with GlusterVolumeEntity

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;
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)

Example 98 with GlusterVolumeEntity

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;
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)

Example 99 with GlusterVolumeEntity

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;
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)

Example 100 with GlusterVolumeEntity

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());
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) Test(org.junit.Test) BaseCommandTest(org.ovirt.engine.core.bll.BaseCommandTest)

Aggregations

GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)220 ArrayList (java.util.ArrayList)57 GlusterBrickEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)49 Test (org.junit.Test)47 Guid (org.ovirt.engine.core.compat.Guid)30 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)30 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)26 GlusterAsyncTask (org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask)20 VDS (org.ovirt.engine.core.common.businessentities.VDS)19 HashMap (java.util.HashMap)16 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)16 List (java.util.List)15 Map (java.util.Map)15 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)15 ActionType (org.ovirt.engine.core.common.action.ActionType)13 GlusterGeoRepSession (org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession)13 GlusterVolumeSnapshotEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity)13 GlusterVolumeType (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType)13 GlusterVolumeRemoveBricksParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters)12 GlusterTaskType (org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType)12