summaryrefslogtreecommitdiffstats
path: root/nova/tests/conductor
diff options
context:
space:
mode:
authorMichael Kerrin <michael.kerrin@hp.com>2013-03-29 10:19:31 +0000
committerMichael Kerrin <michael.kerrin@hp.com>2013-04-30 12:55:00 +0000
commit2cf1f39d9ea7a9436708c5458d42d4dd75717e16 (patch)
tree515b207787481341a750894b5c2ab40f5f626754 /nova/tests/conductor
parent83f6fc8469255ba629ef1f9b8e357a5c87c6ed5a (diff)
downloadnova-2cf1f39d9ea7a9436708c5458d42d4dd75717e16.tar.gz
nova-2cf1f39d9ea7a9436708c5458d42d4dd75717e16.tar.xz
nova-2cf1f39d9ea7a9436708c5458d42d4dd75717e16.zip
Add the availability_zone to the volume.usage notifications
The volume.usage notifications are used to enable traffic based billing on volumes. The availability_zone of the instance is an important piece of information that can enable more specialized billing of customers. This makes the volume.usage events consistent with the volume.create.start/end snapshot.create.start/end, etc. emitted from cinder, which contain the availability_zone field. Change-Id: I9b6b03174cd03235d0e6cf01e34a6da13bd9bb70
Diffstat (limited to 'nova/tests/conductor')
-rw-r--r--nova/tests/conductor/test_conductor.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py
index 9731a76d7..b3088855a 100644
--- a/nova/tests/conductor/test_conductor.py
+++ b/nova/tests/conductor/test_conductor.py
@@ -82,6 +82,7 @@ class _BaseTestCase(object):
inst['ephemeral_gb'] = 0
inst['architecture'] = 'x86_64'
inst['os_type'] = 'Linux'
+ inst['availability_zone'] = 'fake-az'
inst.update(params)
return db.instance_create(self.context, inst)
@@ -374,17 +375,18 @@ class _BaseTestCase(object):
def test_vol_usage_update(self):
self.mox.StubOutWithMock(db, 'vol_usage_update')
+ inst = self._create_fake_instance({
+ 'project_id': 'fake-project_id',
+ 'user_id': 'fake-user_id',
+ })
db.vol_usage_update(self.context, 'fake-vol', 'rd-req', 'rd-bytes',
- 'wr-req', 'wr-bytes', 'fake-id',
- 'fake-project_id', 'fake-user_id', 'fake-refr',
- 'fake-bool')
+ 'wr-req', 'wr-bytes', inst['uuid'],
+ 'fake-project_id', 'fake-user_id', 'fake-az',
+ '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',
- 'project_id': 'fake-project_id',
- 'user_id': 'fake-user_id'},
- 'fake-refr', 'fake-bool')
+ inst, 'fake-refr', 'fake-bool')
def test_compute_node_create(self):
self.mox.StubOutWithMock(db, 'compute_node_create')