summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/tests/test_libvirt.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index f27905ed4..500a4d133 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -1844,14 +1844,17 @@ disk size: 4.4M''', ''))
libvirt_utils.run_ajaxterm(shell_cmd, token, port)
def test_get_fs_info(self):
- stdout, stderr = utils.execute('df', '-B1', '/tmp')
+ # Use a 1024-byte block size (df -k) because OS X does not support
+ # the -B flag
+ blocksize = 1024
+ stdout, stderr = utils.execute('df', '-k', '/tmp')
info_line = ' '.join(stdout.split('\n')[1:])
_dev, total, used, free, _percentage, _mntpnt = info_line.split()
fs_info = libvirt_utils.get_fs_info('/tmp')
- self.assertEquals(int(total), fs_info['total'])
- self.assertEquals(int(free), fs_info['free'])
- self.assertEquals(int(used), fs_info['used'])
+ self.assertEquals(int(total) * blocksize, fs_info['total'])
+ self.assertEquals(int(free) * blocksize, fs_info['free'])
+ self.assertEquals(int(used) * blocksize, fs_info['used'])
def test_fetch_image(self):
self.mox.StubOutWithMock(images, 'fetch')