Beispiel #1
0
 def test_filter_num_instances_fails(self):
     self.flags(max_instances_per_host=5, group='filter_scheduler')
     self.filt_cls = num_instances_filter.NumInstancesFilter()
     host = fakes.FakeHostState('host1', 'node1', {'num_instances': 5})
     spec_obj = objects.RequestSpec()
     self.assertFalse(self.filt_cls.host_passes(host, spec_obj))
 def test_filter_num_instances_fails(self):
     self.flags(max_instances_per_host=5)
     self.filt_cls = num_instances_filter.NumInstancesFilter()
     host = fakes.FakeHostState('host1', 'node1', {'num_instances': 5})
     filter_properties = {}
     self.assertFalse(self.filt_cls.host_passes(host, filter_properties))
Beispiel #3
0
 def test_filter_num_instances_passes(self):
     self.flags(max_instances_per_host=5)
     self.filt_cls = num_instances_filter.NumInstancesFilter()
     host = fakes.FakeHostState('host1', 'node1', {'num_instances': 4})
     spec_obj = objects.RequestSpec()
     self.assertTrue(self.filt_cls.host_passes(host, spec_obj))