summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorDan Smith <danms@us.ibm.com>2013-01-04 09:01:29 -0800
committerGerrit Code Review <review@openstack.org>2013-01-05 03:26:30 +0000
commitba2a0565a6451ee3227b6e11bbdd8ea75cbf1fc3 (patch)
tree1fb950f9c010e317bff621da557ca39d9219cd76 /nova/tests
parent6323c80323d01e042558bd78e74c5d6da66a1e17 (diff)
Move vol_usage methods to conductor
This patch moves the compute/manager's use of the following methods to conductor: - vol_usage_update() - vol_get_usage_by_time() Related to blueprint no-db-compute-manager Change-Id: I51a30d66be51eb532cb19c8b06b87ad07387dd54
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/conductor/test_conductor.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py
index 454d5347a..d2c3df19a 100644
--- a/nova/tests/conductor/test_conductor.py
+++ b/nova/tests/conductor/test_conductor.py
@@ -308,6 +308,26 @@ class _BaseTestCase(object):
result = self.conductor.instance_type_get(self.context, 'fake-id')
self.assertEqual(result, 'fake-type')
+ def test_vol_get_usage_by_time(self):
+ self.mox.StubOutWithMock(db, 'vol_get_usage_by_time')
+ db.vol_get_usage_by_time(self.context, 'fake-time').AndReturn(
+ 'fake-usage')
+ self.mox.ReplayAll()
+ result = self.conductor.vol_get_usage_by_time(self.context,
+ 'fake-time')
+ self.assertEqual(result, 'fake-usage')
+
+ def test_vol_usage_update(self):
+ self.mox.StubOutWithMock(db, 'vol_usage_update')
+ db.vol_usage_update(self.context, 'fake-vol', 'rd-req', 'rd-bytes',
+ 'wr-req', 'wr-bytes', 'fake-id', 'fake-refr',
+ 'fake-bool')
+ self.mox.ReplayAll()
+ self.conductor.vol_usage_update(self.context, 'fake-vol', 'rd-req',
+ 'rd-bytes', 'wr-req', 'wr-bytes',
+ {'uuid': 'fake-id'}, 'fake-refr',
+ 'fake-bool')
+
class ConductorTestCase(_BaseTestCase, test.TestCase):
"""Conductor Manager Tests"""