summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-05-05 05:30:58 -0700
committerSandy Walsh <sandy.walsh@rackspace.com>2011-05-05 05:30:58 -0700
commit4b03036214cff2fcaad079f84605737d7f9dc711 (patch)
tree8a97872b5eb6757c8dcf30c0b16f7250fabbb2a8
parent5a066cf5c2b952371eea753dcd0f95f917d08744 (diff)
not =
-rw-r--r--nova/tests/test_query.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/nova/tests/test_query.py b/nova/tests/test_query.py
index 9bfc83b75..78e8ee9de 100644
--- a/nova/tests/test_query.py
+++ b/nova/tests/test_query.py
@@ -153,4 +153,14 @@ class QueryTestCase(test.TestCase):
just_hosts.sort()
for index, host in zip([1, 2, 4, 5, 6, 7, 8, 9, 10], just_hosts):
self.assertEquals('host%02d' % index, host)
+
+ raw = ['in', '$compute.host_memory.free', 20, 40, 60, 80, 100]]
+ cooked = json.dumps(raw)
+ hosts = driver.filter_hosts(self.zone_manager, cooked)
+
+ self.assertEquals(5, len(hosts))
+ just_hosts = [host for host, caps in hosts]
+ just_hosts.sort()
+ for index, host in zip([2, 4, 6, 8, 10], just_hosts):
+ self.assertEquals('host%02d' % index, host)