Search in sources :

Example 21 with VdsDynamic

use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.

the class RestartVdsCommand method updateHostInFenceFlow.

private void updateHostInFenceFlow(Guid hostId, boolean isInFenceFlow) {
    TransactionSupport.executeInNewTransaction(() -> {
        VdsDynamic vdsDynamic = vdsDynamicDao.get(hostId);
        vdsDynamic.setInFenceFlow(isInFenceFlow);
        vdsDynamicDao.update(vdsDynamic);
        return null;
    });
}
Also used : VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic)

Example 22 with VdsDynamic

use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.

the class VdsDynamicDaoTest method generateNewEntity.

@Override
protected VdsDynamic generateNewEntity() {
    VdsDynamic newDynamicVds = new VdsDynamic();
    newDynamicVds.setId(FixturesTool.VDS_JUST_STATIC_ID);
    newDynamicVds.setUpdateAvailable(true);
    return newDynamicVds;
}
Also used : VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic)

Example 23 with VdsDynamic

use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.

the class VdsDynamicDaoTest method testUpdateNetConfigDirty.

@Test
public void testUpdateNetConfigDirty() {
    VdsDynamic before = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
    Boolean netConfigDirty = before.getNetConfigDirty();
    netConfigDirty = Boolean.FALSE.equals(netConfigDirty);
    before.setNetConfigDirty(netConfigDirty);
    dao.updateNetConfigDirty(before.getId(), netConfigDirty);
    VdsDynamic after = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
    assertEquals(before, after);
}
Also used : VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) Test(org.junit.Test)

Example 24 with VdsDynamic

use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.

the class VdsDynamicDaoTest method testUpdateStatusAndReasons.

@Test
public void testUpdateStatusAndReasons() {
    VdsDynamic before = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
    before.setStatus(RandomUtils.instance().nextEnum(VDSStatus.class));
    before.setNonOperationalReason(RandomUtils.instance().nextEnum(NonOperationalReason.class));
    before.setMaintenanceReason(RandomUtils.instance().nextString(50));
    dao.updateStatusAndReasons(before);
    VdsDynamic after = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
    assertEquals(before, after);
    assertEquals(before.getStatus(), after.getStatus());
    assertEquals(before.getNonOperationalReason(), after.getNonOperationalReason());
    assertEquals(before.getMaintenanceReason(), after.getMaintenanceReason());
}
Also used : VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) NonOperationalReason(org.ovirt.engine.core.common.businessentities.NonOperationalReason) Test(org.junit.Test)

Example 25 with VdsDynamic

use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.

the class VdsDynamicDaoTest method testUpdateStatus.

@Test
public void testUpdateStatus() {
    VdsDynamic before = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
    before.setStatus(VDSStatus.Down);
    dao.updateStatus(before.getId(), before.getStatus());
    VdsDynamic after = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
    assertEquals(before, after);
}
Also used : VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) Test(org.junit.Test)

Aggregations

VdsDynamic (org.ovirt.engine.core.common.businessentities.VdsDynamic)27 Test (org.junit.Test)6 ArrayList (java.util.ArrayList)4 VDS (org.ovirt.engine.core.common.businessentities.VDS)4 Before (org.junit.Before)3 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)3 VdsStatic (org.ovirt.engine.core.common.businessentities.VdsStatic)3 VDSStatus (org.ovirt.engine.core.common.businessentities.VDSStatus)2 OS (org.ovirt.engine.core.utils.OS)2 HashMap (java.util.HashMap)1 PermissionSubject (org.ovirt.engine.core.bll.utils.PermissionSubject)1 StoragePoolValidator (org.ovirt.engine.core.bll.validator.storage.StoragePoolValidator)1 CreateOrUpdateBond (org.ovirt.engine.core.common.action.CreateOrUpdateBond)1 MaintenanceVdsParameters (org.ovirt.engine.core.common.action.MaintenanceVdsParameters)1 UpgradeHostParameters (org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters)1 NonOperationalReason (org.ovirt.engine.core.common.businessentities.NonOperationalReason)1 ServerCpu (org.ovirt.engine.core.common.businessentities.ServerCpu)1 VdsTransparentHugePagesState (org.ovirt.engine.core.common.businessentities.VdsTransparentHugePagesState)1 Bond (org.ovirt.engine.core.common.businessentities.network.Bond)1 DnsResolverConfiguration (org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration)1