Search in sources :

Example 16 with VdsStatic

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

the class UpdateVdsCommand method shouldVdsBeReinstalled.

private boolean shouldVdsBeReinstalled() {
    VdsStatic vdsStatic = getParameters().getVdsStaticData();
    VdsStatic oldVdsStatic = oldHost.getStaticData();
    return vdsStatic.isReinstallRequired() || !Objects.equals(vdsStatic.isPmKdumpDetection(), oldVdsStatic.isPmKdumpDetection()) || !Objects.equals(vdsStatic.getCurrentKernelCmdline(), oldVdsStatic.getCurrentKernelCmdline());
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic)

Example 17 with VdsStatic

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

the class VdsHandlerTest method testUpdateNonEditableFieldOnDownHost.

@Test
public void testUpdateNonEditableFieldOnDownHost() {
    // Given
    VdsStatic src = new VdsStatic();
    src.setServerSslEnabled(true);
    VdsStatic dest = new VdsStatic();
    dest.setServerSslEnabled(false);
    // When
    boolean updateIsValid = vdsHandler.isUpdateValid(src, dest, VDSStatus.Down);
    // Then
    assertFalse("Update should not be valid for different server SSL enabled states", updateIsValid);
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) Test(org.junit.Test)

Example 18 with VdsStatic

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

the class VdsHandlerTest method testValidUpdateOfEditableFieldOnDownHost.

@Test
public void testValidUpdateOfEditableFieldOnDownHost() {
    // Given
    VdsStatic src = new VdsStatic();
    src.setName(RandomUtils.instance().nextString(10));
    VdsStatic dest = new VdsStatic();
    dest.setName(RandomUtils.instance().nextString(10));
    // When
    boolean updateIsValid = vdsHandler.isUpdateValid(src, dest, VDSStatus.Down);
    // Then
    assertTrue("Update should be valid for different names in down status", updateIsValid);
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) Test(org.junit.Test)

Example 19 with VdsStatic

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

the class VdsHandlerTest method testInvalidUpdateOfStatusRestrictedEditableFieldOnRunningHost.

@Test
public void testInvalidUpdateOfStatusRestrictedEditableFieldOnRunningHost() {
    // Given
    VdsStatic src = new VdsStatic();
    src.setClusterId(Guid.newGuid());
    VdsStatic dest = new VdsStatic();
    dest.setClusterId(Guid.newGuid());
    // When
    boolean updateIsValid = vdsHandler.isUpdateValid(src, dest, VDSStatus.Up);
    // Then
    assertFalse("Update should not be valid for different cluster IDs on a running host", updateIsValid);
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) Test(org.junit.Test)

Example 20 with VdsStatic

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

the class VdsHandlerTest method testValidUpdateOfEditableFieldOnRunningHost.

@Test
public void testValidUpdateOfEditableFieldOnRunningHost() {
    // Given
    VdsStatic src = new VdsStatic();
    src.setName(RandomUtils.instance().nextString(10));
    VdsStatic dest = new VdsStatic();
    dest.setName(RandomUtils.instance().nextString(10));
    // When
    boolean updateIsValid = vdsHandler.isUpdateValid(src, dest, VDSStatus.Up);
    // Then
    assertTrue("Update should be valid for different names", updateIsValid);
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) Test(org.junit.Test)

Aggregations

VdsStatic (org.ovirt.engine.core.common.businessentities.VdsStatic)49 Test (org.junit.Test)10 Guid (org.ovirt.engine.core.compat.Guid)8 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Map (java.util.Map)3 Objects (java.util.Objects)3 Before (org.junit.Before)3 HostProviderProxy (org.ovirt.engine.core.bll.host.provider.HostProviderProxy)3 VdsDynamic (org.ovirt.engine.core.common.businessentities.VdsDynamic)3 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)3 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 Inject (javax.inject.Inject)2 StringUtils (org.apache.commons.lang.StringUtils)2 Host (org.ovirt.engine.api.model.Host)2