Search in sources :

Example 31 with PerHostMessages

use of org.ovirt.engine.core.common.scheduling.PerHostMessages in project ovirt-engine by oVirt.

the class VmToHostAffinityFilterPolicyUnitTest method testNegativeAffinity.

@Test
public void testNegativeAffinity() throws Exception {
    hosts = Arrays.asList(host_negative_enforcing, host_not_in_affinity_group);
    List<AffinityGroup> affinityGroups = Arrays.asList(negative_enforcing_group);
    doReturn(affinityGroups).when(affinityGroupDao).getAllAffinityGroupsByVmId(any());
    assertThat(unit.filter(cluster, hosts, vm, new HashMap<>(), new PerHostMessages())).contains(host_not_in_affinity_group);
}
Also used : PerHostMessages(org.ovirt.engine.core.common.scheduling.PerHostMessages) AffinityGroup(org.ovirt.engine.core.common.scheduling.AffinityGroup) Test(org.junit.Test)

Aggregations

PerHostMessages (org.ovirt.engine.core.common.scheduling.PerHostMessages)31 Test (org.junit.Test)24 VDS (org.ovirt.engine.core.common.businessentities.VDS)24 VM (org.ovirt.engine.core.common.businessentities.VM)9 HugePage (org.ovirt.engine.core.common.businessentities.HugePage)8 HashMap (java.util.HashMap)5 AffinityGroup (org.ovirt.engine.core.common.scheduling.AffinityGroup)5 ArrayList (java.util.ArrayList)4 PendingHugePages (org.ovirt.engine.core.bll.scheduling.pending.PendingHugePages)4 Guid (org.ovirt.engine.core.compat.Guid)4 List (java.util.List)3 Map (java.util.Map)3 PolicyUnitImpl (org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl)3 PendingResourceManager (org.ovirt.engine.core.bll.scheduling.pending.PendingResourceManager)3 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)3 Label (org.ovirt.engine.core.common.businessentities.Label)3 LabelBuilder (org.ovirt.engine.core.common.businessentities.LabelBuilder)3 EngineMessage (org.ovirt.engine.core.common.errors.EngineMessage)3 PolicyUnit (org.ovirt.engine.core.common.scheduling.PolicyUnit)3 Logger (org.slf4j.Logger)3