summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-04-23 18:07:11 +0000
committerGerrit Code Review <review@openstack.org>2013-04-23 18:07:11 +0000
commit1ff01cc64764ada3ca38c95b321156f1b0df8530 (patch)
treeaba4a5e96ea488f74342f1e5ce9b47bdc8203459 /nova/tests
parent98efba2dff8f67220595447728f69330089a3ebd (diff)
parent32e455282250efa385984085f1ecd8847cc6be2c (diff)
Merge "Correct disk's over committed size computing error"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_libvirt.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index e26c25ff1..386476cd2 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -2488,7 +2488,7 @@ class LibvirtConnTestCase(test.TestCase):
self.mox.StubOutWithMock(os.path, "getsize")
os.path.getsize('/test/disk').AndReturn((10737418240))
- os.path.getsize('/test/disk.local').AndReturn((21474836480))
+ os.path.getsize('/test/disk.local').AndReturn((3328599655))
ret = ("image: /test/disk\n"
"file format: raw\n"
@@ -2512,10 +2512,12 @@ class LibvirtConnTestCase(test.TestCase):
self.assertEquals(info[0]['path'], '/test/disk')
self.assertEquals(info[0]['disk_size'], 10737418240)
self.assertEquals(info[0]['backing_file'], "")
+ self.assertEquals(info[0]['over_committed_disk_size'], 0)
self.assertEquals(info[1]['type'], 'qcow2')
self.assertEquals(info[1]['path'], '/test/disk.local')
self.assertEquals(info[1]['virt_disk_size'], 21474836480)
self.assertEquals(info[1]['backing_file'], "file")
+ self.assertEquals(info[1]['over_committed_disk_size'], 18146236825)
db.instance_destroy(self.context, instance_ref['uuid'])
@@ -3119,11 +3121,13 @@ class LibvirtConnTestCase(test.TestCase):
fake_disks = {'fake1': [{'type': 'qcow2', 'path': '/somepath/disk1',
'virt_disk_size': '10737418240',
'backing_file': '/somepath/disk1',
- 'disk_size':'83886080'}],
+ 'disk_size':'83886080',
+ 'over_committed_disk_size':'10653532160'}],
'fake2': [{'type': 'raw', 'path': '/somepath/disk2',
- 'virt_disk_size': '10737418240',
+ 'virt_disk_size': '0',
'backing_file': '/somepath/disk2',
- 'disk_size':'10737418240'}]}
+ 'disk_size':'10737418240',
+ 'over_committed_disk_size':'0'}]}
def get_info(instance_name):
return jsonutils.dumps(fake_disks.get(instance_name))