use of org.ovirt.engine.core.common.scheduling.PerHostMessages in project ovirt-engine by oVirt.
the class CpuPinningPolicyUnitTest method setUp.
@Before
public void setUp() {
hostWithCpus = new VDS();
hostWithCpus.setId(Guid.newGuid());
hostWithCpus.setOnlineCpus("0, 1, 2,3, 5");
hostWithoutCpus = new VDS();
hostWithoutCpus.setId(Guid.newGuid());
hostWithoutCpus.setOnlineCpus(null);
perHostMessages = new PerHostMessages();
vm = new VM();
vm.setId(Guid.newGuid());
cluster = new Cluster();
}
use of org.ovirt.engine.core.common.scheduling.PerHostMessages in project ovirt-engine by oVirt.
the class HugePagesFilterPolicyUnitTest method testEnoughFreeHugePagesOnHostBadSizeAvailableAndPending.
@Test
public void testEnoughFreeHugePagesOnHostBadSizeAvailableAndPending() throws Exception {
vm.setCustomProperties("hugepages=1024");
host1.setHugePages(Arrays.asList(new HugePage(1024, 1050), new HugePage(2048, 1025)));
pendingResourceManager.addPending(new PendingHugePages(host1, otherVm, 2048, 1024));
HugePagesFilterPolicyUnit unit = new HugePagesFilterPolicyUnit(null, pendingResourceManager);
List<VDS> hosts = unit.filter(null, Collections.singletonList(host1), vm, Collections.emptyMap(), new PerHostMessages());
assertThat(hosts).isNotEmpty().contains(host1);
}
use of org.ovirt.engine.core.common.scheduling.PerHostMessages in project ovirt-engine by oVirt.
the class HugePagesFilterPolicyUnitTest method testEnoughFreeHugePagesOnHostBadSizePending.
@Test
public void testEnoughFreeHugePagesOnHostBadSizePending() throws Exception {
vm.setCustomProperties("hugepages=1024");
host1.setHugePages(Collections.singletonList(new HugePage(1024, 1050)));
pendingResourceManager.addPending(new PendingHugePages(host1, otherVm, 2048, 1024));
HugePagesFilterPolicyUnit unit = new HugePagesFilterPolicyUnit(null, pendingResourceManager);
List<VDS> hosts = unit.filter(null, Collections.singletonList(host1), vm, Collections.emptyMap(), new PerHostMessages());
assertThat(hosts).isNotEmpty().contains(host1);
}
use of org.ovirt.engine.core.common.scheduling.PerHostMessages in project ovirt-engine by oVirt.
the class HugePagesFilterPolicyUnitTest method testHugePagesNotPresentOnHost.
@Test
public void testHugePagesNotPresentOnHost() throws Exception {
vm.setCustomProperties("hugepages=1024");
HugePagesFilterPolicyUnit unit = new HugePagesFilterPolicyUnit(null, pendingResourceManager);
List<VDS> hosts = unit.filter(null, Collections.singletonList(host1), vm, Collections.emptyMap(), new PerHostMessages());
assertThat(hosts).isEmpty();
}
use of org.ovirt.engine.core.common.scheduling.PerHostMessages in project ovirt-engine by oVirt.
the class HugePagesFilterPolicyUnitTest method testHugePagesGoodAndWrongSizeOnHost.
@Test
public void testHugePagesGoodAndWrongSizeOnHost() throws Exception {
vm.setCustomProperties("hugepages=1024");
host1.setHugePages(Arrays.asList(new HugePage(1024, 5), new HugePage(2048, 50)));
HugePagesFilterPolicyUnit unit = new HugePagesFilterPolicyUnit(null, pendingResourceManager);
List<VDS> hosts = unit.filter(null, Collections.singletonList(host1), vm, Collections.emptyMap(), new PerHostMessages());
assertThat(hosts).isEmpty();
}
Aggregations