def test_aggregate_filter_num_iops_value_error(self, agg_mock):
     self.flags(max_io_ops_per_host=8)
     self.filt_cls = io_ops_filter.AggregateIoOpsFilter()
     host = fakes.FakeHostState('host1', 'node1', {'num_io_ops': 7})
     agg_mock.return_value = set(['XXX'])
     spec_obj = objects.RequestSpec(context=mock.sentinel.ctx)
     self.assertTrue(self.filt_cls.host_passes(host, spec_obj))
     agg_mock.assert_called_once_with(host, 'max_io_ops_per_host')
예제 #2
0
 def test_aggregate_filter_num_iops_value_error(self, agg_mock):
     self.flags(max_io_ops_per_host=8)
     self.filt_cls = io_ops_filter.AggregateIoOpsFilter()
     host = fakes.FakeHostState('host1', 'node1', {'num_io_ops': 7})
     agg_mock.return_value = set(['XXX'])
     filter_properties = {'context': mock.sentinel.ctx}
     self.assertTrue(self.filt_cls.host_passes(host, filter_properties))
     agg_mock.assert_called_once_with(host, 'max_io_ops_per_host')