summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorBrian Elliott <brian.elliott@rackspace.com>2012-09-28 02:54:51 +0000
committerBrian Elliott <brian.elliott@rackspace.com>2012-09-28 06:23:47 +0000
commit2c50abe05af33d7150cbeec40bcdf31a626c0844 (patch)
treed88c22dee340302669ff94d460ee0ad125074ba2 /nova/tests
parent64702669c879dbc5cf27712ef8fadb9fd043664d (diff)
Max I/O ops per host scheduler filter
Provide ability to filter hosts based on the number of concurrent build, resize, and image snapshot operations in progress. FLAGS.max_io_ops_per_host is used to control the number of concurrent permitted operations. Change-Id: I77feca00a6b6b248de8423cef7fb8da2cf704930
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/scheduler/test_host_filters.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/nova/tests/scheduler/test_host_filters.py b/nova/tests/scheduler/test_host_filters.py
index 42d43a197..b1e1ec897 100644
--- a/nova/tests/scheduler/test_host_filters.py
+++ b/nova/tests/scheduler/test_host_filters.py
@@ -1278,3 +1278,19 @@ class HostFiltersTestCase(test.TestCase):
retry = dict(num_attempts=1, hosts=['host3', 'host1'])
filter_properties = dict(retry=retry)
self.assertFalse(filt_cls.host_passes(host, filter_properties))
+
+ def test_filter_num_iops_passes(self):
+ self.flags(max_io_ops_per_host=8)
+ filt_cls = self.class_map['IoOpsFilter']()
+ host = fakes.FakeHostState('host1', 'compute',
+ {'num_io_ops': 7})
+ filter_properties = {}
+ self.assertTrue(filt_cls.host_passes(host, filter_properties))
+
+ def test_filter_num_iops_fails(self):
+ self.flags(max_io_ops_per_host=8)
+ filt_cls = self.class_map['IoOpsFilter']()
+ host = fakes.FakeHostState('host1', 'compute',
+ {'num_io_ops': 8})
+ filter_properties = {}
+ self.assertFalse(filt_cls.host_passes(host, filter_properties))